Search code examples
ropencpu

OpenCPU how to install a package in R/pub?


I'm unclear about how to install an R package under R/pub in openCPU on my own openCPU server. The openCPU documentation states that package installation is handled by the administrator, but does not give any instructions (that I can find) concerning package installation.

I'm sure I'm missing something obvious but any help with this would be appreciated.

FWIW, I'm attempting to install the ''markdown'' package, which for some reason wasn't installed when calling opencpu-cran.


UPDATE: I found this link to an example. It calls to the following URL "/Radmin/call/opencpu.demo/install.opencpu/json", but that approach appears not to work based on this SO question. So, if that's not the way to install packages via openCPU, how is it done?


Solution

  • The /R/pub endpoint contains all packages in public R libraries on the system. To install a package, you could ssh into the system, start R as root sudo -i R and then simply use install.packages to install the packages to the global library.

    Alternatively, you can install one of the many r-cran-* packages which are available through the ubuntu repositories or cran2deb4ubuntu launchpad, e.g:

    sudo apt-get install r-cran-xml