2
votes

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.

2
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
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. - user2922021
@TimurMedjitov I saw your retracted question inside-r.org/questions/… 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 digitalocean.com/community/articles/… - jdharrison

2 Answers

1
votes

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

0
votes

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.