How to install.packages in shiny server

2,647 views
Skip to first unread message

Indra Kshattry

unread,
Mar 31, 2014, 6:13:31 PM3/31/14
to shiny-...@googlegroups.com
I have deployed my work shiny server (Unix remote). Now I need to install package "numbers" in R shiny server, I tried but in vain.
Can any body rescue me getting the problem solved.
Thank you

Indra

Tyler Hunt

unread,
Apr 2, 2014, 3:34:03 PM4/2/14
to shiny-...@googlegroups.com

There are several spots where I can see this issue coming up.  Where are you stuck?  Have you used ssh to connect and have you installed R on the machine?

I will poke in the dark...
I was having issues installing packages because I was not the root user.  So I just used the code from RStudio and added in my dependent packages like so.

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

You might also try 

sudo R 
and then use 

install.packages("numbers")

Jeff Allen

unread,
Apr 3, 2014, 12:12:53 AM4/3/14
to shiny-...@googlegroups.com
I like the first option. In the second, you'll need to watch out for an unchanged library path -- i.e. you may be running the R process as root but still inherit in your R library settings from your unprivileged user, thus you'll just end up installing into the same library you would have without being root.

However, you can use the '-i' option on Linux to request that you get the full-fledged root session which gets around this problem:

sudo -i R

Again, the cleanest is probably Tyler's first solution.

Jeff

Patrick Toche

unread,
Apr 1, 2014, 3:03:54 AM4/1/14
to shiny-...@googlegroups.com
on spark.rstudio.com, I first ssh like so: ssh myn...@spark.rstudio.com, type in the password, then launch R by typing R at the prompt, and then type install.packages("numbers") at the other prompt. But I don't know if this would work for you...
Reply all
Reply to author
Forward
0 new messages