4

Let me confess first I am new to Docker / opencpu world. here is the issue.

  1. I installed Docker from opencpu site on my windows 10 box.
  2. I was able to successfully run the docker by "docker run --name myDocker -t -p 80:80 -p 8004:8004 opencpu/rstudio".
  3. I successfully installed my R package by "R CMD INSTALL /tmp/AnotherPackage_0.1.0.tar.gz".
  4. Only issue now is I cant see my Package in http://localhost/ocpu/test/. so in below figure I cant see my package in right box (which shows all the other packages). enter image description here

If I do /library/AnotherPackage in Endpoint text box I can see my package's description etc..

ahsant
  • 1,003
  • 4
  • 17
  • 25

2 Answers2

3

You probably installed the package in another library. Can you show us the output of your R CMD INSTALL line? In particular the final line that starts with installing to....

To install into the global library, either install as user opencpu:

sudo su opencpu
R CMD INSTALL /tmp/AnotherPackage_0.1.0.tar.gz

Or install as root:

sudo -i
R CMD INSTALL /tmp/AnotherPackage_0.1.0.tar.gz
Jeroen Ooms
  • 31,998
  • 35
  • 134
  • 207
  • Thanks that did the trick, normal R CMD INSTALL command was installing it under '/usr/local/lib/R/site-library' However, with sudo su opencpu it was installed under '/usr/local/lib/opencpu/site-library'. which is perfect as I can see my package in the app. – ahsant May 24 '18 at 04:45
1

I think you are running it as opencpu user, which means user installed packages are in /ocpu/user/{username}/library/{pkgname}/. See here how to get a root shell so that your package is in /ocpu/library/{pkgname}/ as you expected.

psolymos
  • 66
  • 2