Skip to content
ricochet

R

This page covers the requirements and internals of deploying R content to ricochet.

Every R deployment requires a renv.lock file in the project root. This lockfile is generated by {renv} and records all package dependencies and their versions.

[content]
name = "My Shiny App"
entrypoint = "app.R"
access_type = "external"
content_type = "shiny"
[language]
name = "r"
packages = "renv.lock"
[serve]
min_instances = 0
max_instances = 5

R content items can be deployed as apps or tasks.

Content TypeDescription
plumberAn API developed using {plumber}.
ambiorixAn API or web app developed using {ambiorix}.
shinyA web app developed using {shiny}.
rmd-shinyAn R Markdown document using a Shiny runtime.
quarto-r-shinyA Quarto document using a Shiny runtime.
serverless-rR functions deployed as an API.
r-serviceA generic web app or API using an R runtime.
Content TypeDescription
rAn R script with the extension .R or .r.
rmdAn R Markdown document. Can be served as a static site.
quarto-rA Quarto document using an R runtime. Can be served as a static site.

Ricochet discovers R installations on the host machine. We recommend installing R versions via rig for the best experience managing multiple versions:

Terminal window
rig add <version>

You can also install R from CRAN or your distribution’s package manager.

Ricochet vendors renv at $RICOCHET_HOME/vendor. When a bundle is deployed, ricochet restores R package dependencies from the renv.lock file using the vendored renv.

A deployment shows Out of sync when renv.lock does not match the packages your project uses. Update the lockfile in your project and redeploy:

# list the packages that differ from renv.lock
renv::status()
# record the project library in renv.lock
renv::snapshot()

The badge appears in one of two situations:

  • The restore failed, so the deployment status is Out of sync and a task cannot run until you redeploy.
  • The restore succeeded but reported drift, such as a package that is installed but not recorded in renv.lock.

In the second case your content runs, and hovering the badge shows the message with a link to the matching lines of the restore log.

A server running a different R version than the one recorded in renv.lock does not count as drift.