Skip to content

User guideBuilding

R

Shiny, plumber and R documents — what Toft detects, and why you need renv.lock.

View as Markdown
Framework Detected by
Shiny app.R; ui.R and server.R; server.R with www/index.html; or an .Rmd with runtime: shiny
plumber plumber.R, or a root .R file with #* @get-style annotations
R Markdown one .Rmd at the root, rendered at deploy time
Quarto (knitr) one .qmd whose engine is knitr, rendered at deploy time

File names match in either case (app.r works). The two document types are covered in Notebooks and documents.

There is no generic R app: a script run with Rscript exits, and an app that exits is a crash. An R repository matching none of the four is refused, with the four listed.

renv::init()
renv::snapshot()

Commit renv.lock. You don’t need to commit the renv/ library.

Packages come from a repository your administrator configures. If one won’t install, the build log names it.

With no pin, Toft uses the R version recorded in renv.lock if the install has it, and the default otherwise. To pin explicitly:

toft.toml
[runtime]
r = ">=4.5"

Changing R versions reinstalls every package, so that deploy is slower. See Language versions.

A bundle with a Posit Connect manifest.json and no renv.lock is translated into an renv.lock automatically. You can also publish straight from RStudio’s Publish button — see From RStudio.