When I install RLink:
Needs["RLink`"]
InstallR[]
then evaluate the command
REvaluate["R.version.string"]
I see that it is running
{"R version 2.14.0 (2011-10-31)"}
a version which I did not intentionally install on my system. I believe that Mathematica downloaded this itself. Now I wish to install packages. For example:
REvaluate["install.packages('LaplacesDemon')"]
yields
REvaluate::err:
General error in function RLink`Private`withRTemporaryVariables >>
Is it possible to install packages with Mathematica's version of R? Even a command line solution would be great.
EDIT:
It seems that the error above was an aberration. It stopped showing up after I restarted Mathematica. Following Sasha's advice, I tried to add a repository:
REvaluate["install.packages('LaplacesDemon', repos='http://cran.wustl.edu/')"]
and the error is equally as bad:
REvaluate::rerr: Failed to retrieve the value for variable or piece of code
install.packages('LaplacesDemon', repos='http://cran.wustl.edu/'.
The following R error was encountered: Error in typeof(myRandomVar123456759046) :
object 'myRandomVar123456759046' not found >>
Similar errors for ggplot2, Zelig, etc. There appears to be a whole R tree in
$HomeDirectory/Library/Mathematica/Paclets/Repository/RLinkRuntime-MacOSX-x86-64-9.0.0.0/SystemFiles/MacOSX-x86-64/R/library
but the R version there doesn't seem to be usable.
REvaluatecommand bring a repository selection dialog for me on Windows. – Sasha Nov 29 '12 at 01:21REvaluate[".Library"]to find out the location of R-installation and then run it from a command line. – Sasha Nov 29 '12 at 01:25