All Apps and Add-ons

What is the default folder that the R Analytics app looks for installed R libraries?

xiangtaner
Path Finder

Hi,

What's the default folder that the R Analytics app looks for installed R libraries?

All my R libraries are installed in the folder: /home/{username}/R/x86_64-pc-linux-gnu-library/3.3

But it seems that R Analytics App does NOT show the libraries under it, instead it shows a different set of libraries. I have opencpu installed on the machine where R is installed.

Thanks!

0 Karma
1 Solution

gwobben
Communicator

Hi xiangtaner,

It looks like you've already found the right spot. The packages should be installed to /usr/local/lib/R/site-library and this folder cannot be changed (at least not that I've found). The reason for this is security. When users can execute code in R via the API they might install packages that you don't want in your environment. Therefore R will create a new folder for every request to the API and everything the user does is confined to this folder, including installing packages.

The easiest way to install packages for all users is:

sudo R
install.packages(<package_name>, lib = "/usr/local/lib/R/site-library")

I will update the documentation with these instructions. This is the link to the OpenCPU documentation (chapter 3.2 deals with installing packages): https://cran.r-project.org/web/packages/opencpu/vignettes/opencpu-server.pdf

View solution in original post

gwobben
Communicator

Hi xiangtaner,

It looks like you've already found the right spot. The packages should be installed to /usr/local/lib/R/site-library and this folder cannot be changed (at least not that I've found). The reason for this is security. When users can execute code in R via the API they might install packages that you don't want in your environment. Therefore R will create a new folder for every request to the API and everything the user does is confined to this folder, including installing packages.

The easiest way to install packages for all users is:

sudo R
install.packages(<package_name>, lib = "/usr/local/lib/R/site-library")

I will update the documentation with these instructions. This is the link to the OpenCPU documentation (chapter 3.2 deals with installing packages): https://cran.r-project.org/web/packages/opencpu/vignettes/opencpu-server.pdf

xiangtaner
Path Finder

Hi gwobben, Thanks for the clarification!

0 Karma

xiangtaner
Path Finder

Found out that the R libraries location that R Analytics App use is /usr/lib/R/library which is the system R libraries. Then the question is whether we can change it to R user library /home/{username}/R/x86_64-pc-linux-gnu-library/3.3.

Thanks!

0 Karma
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...