Search code examples
rstudioroxygen2opencpu

Cannot see all my functions when running Open CPU single-user server


When I run ocpu_start_app("my_package") not all the functions are displayed and I cannot access those that are not listed, although they are under the my_package/R/ folder as the OpenCPU documentation states.


Solution

  • In my case, it seemed to be an issue with roxygen2. This package creates the documentation and the NAMESPACE file that OpenCPU uses. For some reason, roxygen2 wasn't executing automatically when I built my package from RStudio (Ubuntu 18.04). So I had to run manually roxygen2. You can do this in several ways:

    From roxygen2 documentation:

    roxygen2::roxygenise(), or

    devtools::document(), if you’re using devtools, or

    Ctrl + Shift + D, if you’re using RStudio.

    After this, I just had to rebuild my project and relaunch the OpenCPU single server and all started working again.