Hi there

I have an Rscript and I am looking for a way to install a package
non-interactively. In Rscript {Utils}, I saw an example which does
something like this, however this does not seem to work for my particular
example. I am trying to install the following package in an Rscript
(without switching to interactive mode).

res <- try(install.packages("DEoptim"))

if(inherits(res, "try-error")) q(status=1) else q()


Error:

Installing package(s) into ‘/home/xx/R/x86_64-pc-linux-gnu-library/2.13’

(as ‘lib’ is unspecified)

Error in contrib.url(repos, type) :

  trying to use CRAN without setting a mirror


Any idea how I can fix this or specify "lib"? Any help would be most
appreciated.

Thank you in advance,
Diviya

        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to