Hello, everyone I run Eclipse Ganymede and R 2.7.2 at work. I have one R script file where I open in memory a new xls file (using xlsReadWritePro), call other R scripts, which are in the same folder as the main R script, which get data from an existing xls file, process data, and output results in the xls file which is in memory. That is the idea. But I cannot make it work. First, I do not really know how to call other R scripts from an R script. I am using function source like this: source(file="G:/data/datafile.xls") I get a following error (in German, as I work with German Windows): Converting xls file to csv file... Fehler in system(cmd, intern !verbose) : perl nicht gefunden Fehler in file.exists(tfn) : ung?ltiges 'file' Argument Basically it says: Converting xls file to csv file...Error in system(cmd, intern !verbose) : perl not found Error in file.exists(tfn): invalid 'file' Argument What is wrong? How can I call and execute R-scripts from another R-script? Thanks in advance! Regards, Sergey -- Kniven sk?rpes bara mot stenen.
Sorry everyone Disregard this email. I found the problem. I have xlsReadWritePro loaded automatically at start of R. Then I load package gplots, which also loads gdata gdata masks function read.xls() from xlsReadWritePro and that causes all the problems. Regards, Sergey On Mon, Sep 21, 2009 at 17:52, Sergey Goriatchev <sergeyg at gmail.com> wrote:> Hello, everyone > > I run Eclipse Ganymede and R 2.7.2 at work. > I have one R script file where I open in memory a new xls file (using > xlsReadWritePro), call other R scripts, which are in the same folder > as the main R script, > which get data from an existing xls file, process data, and output > results in the xls file which is in memory. > > That is the idea. But I cannot make it work. > First, I do not really know how to call other R scripts from an R script. > I am using function source like this: source(file="G:/data/datafile.xls") > I get a following error (in German, as I work with German Windows): > Converting xls file to csv file... Fehler in system(cmd, intern > !verbose) : perl nicht gefunden > Fehler in file.exists(tfn) : ung?ltiges 'file' Argument > > Basically it says: > Converting xls file to csv file...Error in system(cmd, intern > !verbose) : perl not found > Error in file.exists(tfn): invalid 'file' Argument > > What is wrong? > How can I call and execute R-scripts from another R-script? > > Thanks in advance! > > Regards, > Sergey > > -- > Kniven sk?rpes bara mot stenen. >-- I'm not young enough to know everything. /Oscar Wilde Experience is one thing you can't get for nothing. /Oscar Wilde When you are finished changing, you're finished. /Benjamin Franklin Tell me and I forget, teach me and I remember, involve me and I learn. /Benjamin Franklin Luck is where preparation meets opportunity. /George Patten Kniven sk?rpes bara mot stenen.
On Sep 21, 2009, at 11:52 AM, Sergey Goriatchev wrote:> Hello, everyone > > I run Eclipse Ganymede and R 2.7.2 at work. > I have one R script file where I open in memory a new xls file (using > xlsReadWritePro), call other R scripts, which are in the same folder > as the main R script, > which get data from an existing xls file, process data, and output > results in the xls file which is in memory. > > That is the idea. But I cannot make it work. > First, I do not really know how to call other R scripts from an R > script. > I am using function source like this: source(file="G:/data/ > datafile.xls")The source function is for reading files that are valid R code, not for reading data files.> I get a following error (in German, as I work with German Windows): > Converting xls file to csv file... Fehler in system(cmd, intern > !verbose) : perl nicht gefunden > Fehler in file.exists(tfn) : ung?ltiges 'file' Argument > > Basically it says: > Converting xls file to csv file...Error in system(cmd, intern > !verbose) : perl not found > Error in file.exists(tfn): invalid 'file' Argument > > What is wrong? > How can I call and execute R-scripts from another R-script?"source" would be the way, but you should be offering it .R files, rather than .xls files. There are other functions designed for reading external data files. See the Import/Export Manual. -- David Winsemius, MD Heritage Laboratories West Hartford, CT