2

When trying to install certain (or all?) R packages, I always bump into the following type of error, which seems to me to be not specific to a particular package, but rather specific to for my R environment.

> install.packages("plspm")
Installing package into ‘/home/ruser/R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
also installing the dependencies ‘shape’, ‘amap’, ‘diagram’, ‘tester’, ‘turner’

trying URL 'http://cran.rstudio.com/src/contrib/shape_1.4.1.tar.gz'
Content type 'application/x-gzip' length 683458 bytes (667 Kb)
opened URL
==================================================
downloaded 667 Kb

trying URL 'http://cran.rstudio.com/src/contrib/amap_0.8-12.tar.gz'
Content type 'application/x-gzip' length 257611 bytes (251 Kb)
opened URL
==================================================
downloaded 251 Kb

trying URL 'http://cran.rstudio.com/src/contrib/diagram_1.6.2.tar.gz'
Content type 'application/x-gzip' length 466608 bytes (455 Kb)
opened URL
==================================================
downloaded 455 Kb

trying URL 'http://cran.rstudio.com/src/contrib/tester_0.1.7.tar.gz'
Content type 'application/x-gzip' length 112000 bytes (109 Kb)
opened URL
==================================================
downloaded 109 Kb

trying URL 'http://cran.rstudio.com/src/contrib/turner_0.1.7.tar.gz'
Content type 'application/x-gzip' length 106530 bytes (104 Kb)
opened URL
==================================================
downloaded 104 Kb

trying URL 'http://cran.rstudio.com/src/contrib/plspm_0.4.1.tar.gz'
Content type 'application/x-gzip' length 367040 bytes (358 Kb)
opened URL
==================================================
downloaded 358 Kb


The downloaded source packages are in
    ‘/tmp/RtmpJsgPbd/downloaded_packages’

> library(plspm)
Error in library(plspm) : there is no package called ‘plspm’

Here's my R environment information:

> sessionInfo()
R version 3.0.3 (2014-03-06)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C         LC_TIME=C           
 [4] LC_COLLATE=C         LC_MONETARY=C        LC_MESSAGES=C       
 [7] LC_PAPER=C           LC_NAME=C            LC_ADDRESS=C        
[10] LC_TELEPHONE=C       LC_MEASUREMENT=C     LC_IDENTIFICATION=C 

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] RCurl_1.95-4.1 bitops_1.0-6  

loaded via a namespace (and not attached):
[1] tools_3.0.3

From within RStudio, I've also tried to specify dependencies=TRUE in install.packages() and specify type="source" (which is default on Linux anyway), but to no avail.

It seems that I've always been able to overcome this problem by successfully installing R packages manually from command line (as ruser user), which was the case this time as well:

R CMD INSTALL --build <'plspm' dependencies and their dependencies>
R CMD INSTALL --build plspm_0.4.1.tar.gz

> library(plspm)
Loading required package: amap
Loading required package: diagram
Loading required package: shape
Loading required package: tester
Loading required package: turner

> installed.packages()
           Package      LibPath
plspm      "plspm"      "/home/ruser/R/x86_64-pc-linux-gnu-library/3.0"

           Version      Priority
plspm      "0.4.1"      NA

           Depends
plspm      "R (>= 3.0.1), amap, diagram, tester, turner"

           NeedsCompilation Built
plspm      "no"             "3.0.3"

Question

Why I have been able to successfully install plspm (and other packages, for that matter) by manually installing its dependencies and then itself, step-by-step, in R sessions launched from command line in Ubuntu as ruser, but have failed to do the same from within RStudio Server?

I would appreciate any advice toward understanding and fixing this systemic problem in my R environment!

Aleksandr Blekh
  • 2,300
  • 4
  • 25
  • 61
  • 1
    Are you on an Amazon EC2 or something similar? If so see http://stackoverflow.com/questions/21837036/install-packages-r-on-ubuntu-12-04-downloads-but-does-not-install-packages#comment33053086_21837036 – jdharrison Mar 21 '14 at 08:14
  • @jdharrison: Yes, I'm using `t1.micro` instance (free tier) on Amazon EC2. Thank you very much for references. I followed the advice there and it seems to work wonderfully. Frankly, I'd expect more informative messages from an R session in system-related situations like that to avoid any confusion. If it's technically possible, of course. Are you aware of an improvement request submitted to R Core Development team? Again, greatly appreciate your help! – Aleksandr Blekh Mar 21 '14 at 08:31
  • This is off topic, but how did you get R 3.0.3 on Ubuntu 12.04? I just switched from Windows and I can only seem to get version 2.14.1 (which is really old). I'm also having trouble installing packages. – Rich Scriven Mar 21 '14 at 08:42
  • @RichardScriven: Just saw your comment - thank you! Hmm, it looks like `jdharrison`'s advice and references helped to solve the problem (at least, in terms of loading the package). However, I'll keep your advice in mind. Oops: you've already deleted it... – Aleksandr Blekh Mar 21 '14 at 08:43
  • @RichardScriven: Yes, I use R 3.0.3 on Ubuntu 12.04 LTS. The upgrade was a result of `sudo apt-get update`, I believe. As far as trouble installing packages, I think you need to install `r-base-dev`. – Aleksandr Blekh Mar 21 '14 at 08:46
  • 1
    Sorry. The comment said that it looks like the package went into a temporary file, making me think that if the package isn't listed in `library(lib.loc = .Library)`, you may need to reconfigure the default package download file path. But I'm definitely not certain about that. – Rich Scriven Mar 21 '14 at 09:03
  • @RichardScriven: Forgot to mention that, if you're still not getting most recent R version via `apt-get`, make sure to check (and update, if needed) your repositories in `/etc/apt/sources.list`. I recommend CRAN or RStudio repos. – Aleksandr Blekh Mar 21 '14 at 09:21
  • Thanks for the tips. I appreciate it. – Rich Scriven Mar 21 '14 at 09:25
  • @RichardScriven: My pleasure! – Aleksandr Blekh Mar 21 '14 at 09:33
  • Based on the comment from @jdharrison (thanks!), the situation appears to be a duplicate of http://stackoverflow.com/questions/21837036/install-packages-r-on-ubuntu-12-04-downloads-but-does-not-install-packages#comment33053086_21837036 and the answer can be found here: http://stackoverflow.com/questions/17173972/how-do-you-add-swap-to-an-ec2-instance. The top solution appears to solve the problem in my R environment, based on Amazon EC2 `t1.micro` instance. – Aleksandr Blekh Mar 21 '14 at 08:38

0 Answers0