`rmarkdown` package in Shiny Server

I would be grateful for some help with a Shiny Server question around hosting R Markdown-Shiny apps.

I've been trying to host an R Markdown-Shiny app on Binderhub (a docker server). Hosting standard Shiny apps is already possible on Binderhub. Hosting R Markdown-Shiny apps (runtime: shiny) hasn't been as straightforward.

Fortunately, Shiny Server implemented a hierarchical logic whereby R Markdown scripts are sought after pure Shiny ones, as quoted below from RStudio.

3.2 R Markdown

In addition to serving traditional Shiny applications out of a directory (a server.R file and an associated UI), Shiny Server now supports interactive R Markdown documents. To take advantage of this capability, you will need to make sure that R Markdown is installed and available for all users. You can do so by running the following command:

sudo su - -c "R -e \"install.packages('rmarkdown')\""

If a hosted directory does not include a server.R file, Shiny Server will look to see if it contains any .Rmd files. If so, Shiny Server will host that directory in "R Markdown" mode using rmarkdown::run.

Particular Rmd files can be accessed by referencing their full path including the filename, e.g., http://myserver.org/mydocs/hello.Rmd. If a request is made to a directory rather than to a particular Rmd file, Shiny Server will attempt to serve the file index.Rmd. If that file does not exist, the user will get an error alerting them that the file is not available.

By this point, based on the above-quoted information from R Studio, I've been asked whether it could be enough to load the library in the Binder repository of interest, using a runtime script, rather than generally on the entire Binder server. Would someone know this?

Thank you very much!

1 Like

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.