[R] script fails because of library loading

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Nov 13 16:42:09 CET 2007


On Tue, 13 Nov 2007, Muiser, EC wrote:

> Thank you very much Alberto! Atleast I can see there is an error now.
> The error however is strange. If I load the library in an R console it works perfectly but the package seems not to exist if I run R from a script. The library should be there.
>
> Errorlog:
>
> Error in library(tgp) : there is no package called 'tgp'
> Execution halted
>
> more suggestions?

Read ?Startup : the startup files read depend on the working directory and 
the account.  I expect one of them sets the library (the real meaning of 
the word, you do not 'load the library': you load packages) path or the 
R_LIBS environment variable.

Please (both of you) stop sending mail to both R-help at stat.math.ethz.ch 
and r-help at r-project.org: they are the same thing.

> Iwe Muiser
>
> ---------------------------------------------
> Iwe E.C. Muiser, Student Bio-Informatics
> Hanze Hogeschool Groningen
> The Netherlands
> Tel +31645700419
> E-mail E.C.Muiser at st.hanze.nl
> ---------------------------------------------
>
> ________________________________
>
> Fra: Alberto Monteiro [mailto:albmont at centroin.com.br]
> Sendt: ti 13-11-2007 14:23
> Til: Muiser, EC; R-help at stat.math.ethz.ch
> Kopi: r-help at r-project.org
> Emne: Re: [R] script fails because of library loading
>
>
>
>
> Muiser, EC wrote:
>>
>> The php script executes the following command: "/usr/bin/R --quiet --
>> slave < /perl/outfiles/Rscript19785065.R
>> /perl/outfiles/error19785065.txt"
>
>> Also there is no errorlog (in
>> "/perl/outfiles/error19785065.txt")
>
> This part is easy: the error output should go to 2> and not to >,
> like this:
>
> "/usr/bin/R --quiet --slave < /perl/outfiles/Rscript19785065.R
> > /perl/outfiles/error19785065.txt 2> error.log"
>
> Alberto Monteiro
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list