Hi Fabricia, François, list, Rscript does not load the methods package. I believe this is so it's creators can feast upon the sweat and tears of innocent souls, or for giving people on R-help reason to chastise people for not reading the entire manual. There's a lame of a claim about time savings in ?Rscript, but I don't believe it, considering that not loading it renders about 50% of the R ecosystem unusable.
I believe that Dirk Eddelbuettel's "little r" ( http://dirk.eddelbuettel.com/code/littler.html) scripting front end does not suffer this insane design decision (and is apparently faster than Rscript too). I tend to preemptively load it in scripts meant to be run with Rscript. Cheers, Rich Not at all bitter. Well, perhaps a bit. On 12 November 2014 22:13, Fabricia Nascimento <[email protected]> wrote: > Hi François, > > Thanks! I am using R version 3.0.3 and the phylobase version 0.6.8. > Adding "library(methods)" in my script does make it work when using > Rscript command. If I remove this line, the script does not work. > However, this is not necessary in RStudio. > > Thanks again! > Fabricia. > > > On 11/9/14 7:30 PM, François Michonneau wrote: > > > > Hi Fabricia, > > > > Which version of phylobase and R are you using? > > > > During the execution of your script, do you see the message: > > "Loading required package: methods" > > > > A quick workaround should be to add "library(methods)" to your > > script but it shouldn't be needed. > > > > Thanks, > > -- François > > > > > > On Sun, Nov 9, 2014 at 10:49 AM, Fabricia Nascimento > > <[email protected] <mailto:[email protected]>> wrote: > > > > Hi, > > > > I wrote a script in R that works totally fine without any errors > > when I > > use RStudio. > > I want to run the same script but in a terminal using Rscript. But > > when > > I try this I get the following error message: /Error in FUN(newX[, > i], > > ...) : could not find function "as"/ > > > > I believe the error is caused because the "as" function exists in > both > > /methods/ and /phylobase/ packages. And somehow when running the > > script > > direct from a terminal using Rscript is gets a conflict and the > script > > does not know which "as" function it should use. > > > > Does anyone know what I should do for my script to work in the > > terminal > > using Rscript? It appears that using "library(phylobase)" is not > > enough. > > > > Thanks very much! > > > > Fabricia. > > > > -- > > ------------------------------------------ > > Fabricia F. Nascimento, Ph.D. > > Postdoctoral Fellow > > The National Evolutionary Synthesis Center > > Durham, NC > > USA > > > > > > [[alternative HTML version deleted]] > > > > _______________________________________________ > > R-sig-phylo mailing list - [email protected] > > <mailto:[email protected]> > > https://stat.ethz.ch/mailman/listinfo/r-sig-phylo > > Searchable archive at > > http://www.mail-archive.com/[email protected]/ > > > > > > -- > ------------------------------------------ > Fabricia F. Nascimento, Ph.D. > Postdoctoral Fellow > The National Evolutionary Synthesis Center > Durham, NC > USA > > > [[alternative HTML version deleted]] > > _______________________________________________ > R-sig-phylo mailing list - [email protected] > https://stat.ethz.ch/mailman/listinfo/r-sig-phylo > Searchable archive at > http://www.mail-archive.com/[email protected]/ > [[alternative HTML version deleted]] _______________________________________________ R-sig-phylo mailing list - [email protected] https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/[email protected]/
