1

Regardless of whether I run R or sudo R, when I then run install.packages("name") the packages always gets installed into /home/james/R/... as opposed to a system library.

(I need the packages in the system library so that Shiny Server can find them)

How do I make R install into the system library instead of a user specific one?

James Ronald
  • 685
  • 1
  • 6
  • 13

1 Answers1

0

I found this on Dean Attali's guide to setting up a shiny server:

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

My understanding is that you're essentially installing the package globally as the root user so that any user can access it. Seems to work well for me so far.

Dharman
  • 30,962
  • 25
  • 85
  • 135
BDuff
  • 46
  • 3