How to develop a package on a Rstudio server with no rights?

36 views Asked by At

I want to develop a private local package on a RStudio server but it seems configured in a way that makes that impossible.

I know that as a simple user I cannot install a package from the outside (eg. CRAN or git). But I have been thinking that I can make my own in order to build and use a set of private tools.

I can create a new package project but when I want to build it, I have the following message:

* installing to library ‘/srv/commun/rstudio-server/libpath_root/R/library/4.1.2’
Erreur : ERROR: no permission to install to directory ‘/srv/commun/rstudio-server/libpath_root/R/library/4.1.2’

Exited with status 1.

Is there any workaround other than sourcing files to build a set of functions?

What can I ask to the RStudio server administrator to allow me to make a local package?

1

There are 1 answers

0
pietrodito On

From the comments, here is a comprehensive answer:

  1. We must create a writeable dir for that eg. ~/R-local-lib/

  1. When building/installing the package, you have to add the following:
R CMD install --library='~/R-local-lib/'

One can set that in the Project Options of the RStudio menus.


  1. Then you add this line to your ~/.Rprofile:
.libPaths(c("~/R-local-lib", .libPaths))