2

I need some help with installing Shiny package on the following system:

Ubuntu 12.04 64 bits R version 3.0.2 "Frisbee Sailing"

When I try to install a Shiny package by running:

sudo su - -c "R -e \"install.packages('shiny', repos='http://cran.rstudio.com/')\""

I tried different repos or even by running install.packages('shiny') in R session as sudo, the package fails to install. There's no errors, but rather a message that "The downloaded source packages are in '/tmp/....' and when I try to use it (library(shiny)), I got an error that package was not found.

Now, I did not have same issue and everything worked fine on:

Ubuntu 12.04 64 bits R version 3.0.1 "Good Sport".

Please, help me see what I am missing here.

  • Just a couple of things to try: Have you tried opening R (or RStudio) and then installing from within? 2. From within R, typing .libPaths() will list the directories that are in your R Lib path. Make sure it is set correctly. – Ram Narasimhan Oct 26 '13 at 15:37
  • Thanks, Ram. I did try to install the package from R session, same result - keeps saving the package in /tmp. It may have something to do with the way it goes on digitalocean hosting. Not sure. But in the end I resolved it as shown below in my Answer. –  Oct 28 '13 at 19:47
  • 2
    @TimurMedjitov I saw your retracted question http://www.inside-r.org/questions/installing-r-packages-digitalocean-com-vps which was probably related to this one. This issue is caused most likely by lack of ram. Enabling swap in digital ocean should fix the issue https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04 – jdharrison Mar 30 '14 at 08:20

2 Answers2

1

The issues you are describing are caused by out-of-memory crashes. You are probably on a VPS like EC2 or something similar. If you are using the free micro instance on EC2 or the lowest package( 512mb ram) on digital ocean then you should enable swap (you should enable swap anyway). For EC2 see How do you add swap to an EC2 instance? . For digital ocean see https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04

Community
  • 1
  • 1
jdharrison
  • 28,335
  • 4
  • 67
  • 86
  • Thank you. I did have this problem with the cheapest digitalocean account and have upgraded it to the next level since that time. But still, I did not realize the swap file was disabled and just enabled it thanks to the link provided. –  Apr 01 '14 at 01:36
0

Actually, I just tried to install a different library, ggplot2, and it is the same issue. So, it is not related to Shiny package. All the libraries I tried to install just keep being saved to a /tmp folder as archived gz files. Not really sure why R does not install them. So, eventually I just used R CMD INSTALL [path to the package .gz] and it worked all right. I installed all 3 libraries in the following order: Rcpp, httpuv and the shiny. library(shiny) command now loads the library ok.