Dear All I want to use R, Rscript und r alternately under one common configuration. The problem is that \"r\" can't find the package \"Rmpi\" and other packages whereas \"R\" has no problem to find. $ R --vanilla < mpiHelloWorld.r #!/usr/bin/env r library(Rmpi) # calls MPI_Init rk <- mpi.comm.rank(0) sz <- mpi.comm.size(0) name <- mpi.get.processor.name() cat( \"Hello, rank \" , rk, \"size\", sz, \"on\", name, \"\\n\") Hello, rank 0 size 1 on lenny157 # ok. $ Rscript mpiHelloWorld.r Hello, rank 0 size 1 on lenny157 # ok. $ r mpiHelloWorld.r Error in library(Rmpi) : there is no package called 'Rmpi' $ r -lRmpi -e 'cat(\"Hello\", mpi.get.processor.name())' Error in library(Rmpi) : there is no package called 'Rmpi' $ R --version R version 2.9.2 (2009-08-24) $r --version r ('littler') version 0.1.0 I have installed the binaries for Lenny using apt-get. Why can't \"r\" find its packages and how do I have to change my configuration? with thanks Stefan Unbegrenzter Speicher, Top-Spamschutz, 120 SMS und eigene E-MailDomain inkl. http://office.freenet.de/dienste/emailoffice/produktuebersicht/power/mail/index.html
On 26 November 2009 at 20:08, Stefan Franke wrote: | Dear All | | I want to use R, Rscript und r alternately under | one common configuration. | The problem is that \"r\" can't find the package \"Rmpi\" | and other packages whereas \"R\" has no problem to find. | | $ R --vanilla < mpiHelloWorld.r | | #!/usr/bin/env r | library(Rmpi) # calls MPI_Init | rk <- mpi.comm.rank(0) | sz <- mpi.comm.size(0) | name <- mpi.get.processor.name() | cat( \"Hello, rank \" , rk, \"size\", sz, \"on\", name, \"\\n\") | | Hello, rank 0 size 1 on lenny157 # ok. | | $ Rscript mpiHelloWorld.r | Hello, rank 0 size 1 on lenny157 # ok. | | $ r mpiHelloWorld.r | Error in library(Rmpi) : there is no package called 'Rmpi' | | $ r -lRmpi -e 'cat(\"Hello\", mpi.get.processor.name())' | Error in library(Rmpi) : there is no package called 'Rmpi' | | $ R --version | R version 2.9.2 (2009-08-24) | | $r --version | r ('littler') version 0.1.0 | | I have installed the binaries for Lenny using apt-get. | Why can't \"r\" find its packages and how do I | have to change my configuration? You probably installed Rmpi somewhere where R knows how to find it, but r doesn't. So do ~> r -e 'print(.libPaths())' [1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library" "/usr/lib/R/library" ~> Rscript -e 'print(.libPaths())' [1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library" "/usr/lib/R/library" ~> echo 'print(.libPaths())' | R --slave [1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library" "/usr/lib/R/library" ~> which on my system are all identical. On yours they may not. Similarly, you can tell r etc where to load a package from, see help(library). Dirk -- Three out of two people have difficulties with fractions.
You were right, I have different paths for my libraries: vmuser at lenny157:~$ r -e 'print(.libPaths())' [1] \"/usr/local/lib/R/site-library\" \"/usr/lib/R/site-library\" [3] \"/usr/lib/R/library\" \"/usr/lib64/R/library\" vmuser at lenny157:~$ Rscript -e 'print(.libPaths())' [1] \"/usr/local/lib64/R/library\" vmuser at lenny157:~$ echo 'print(.libPaths())' | R --slave [1] \"/usr/local/lib64/R/library\" I fixed this by a simple link:> ln -s /usr/local/lib64/R/library/Rmpi /usr/local/lib/R/site-library > ln -s /usr/local/lib64/R/library/snow /usr/local/lib/R/site-libraryIt works, but this is not the best way to do it. What would be your favorite way to set the paths? Greetings, Stefan Heute schon ge"freeMail"t? Jetzt kostenlose E-Mail-Adresse sichern! http://email.freenet.de/dienste/emailoffice/produktuebersicht/basic/mail/index.html?pid=6831