manifesto
provides a lightweight, portable way to declare R project environments using a simple rproject.toml
file.
It makes setting up and sharing reproducible R projects faster and more reliable. As it is lightweight, it can also be used easily for setting up new R installations or for workshops which require packages.
Unlike most reproducibility-ish packages, this is not focused on being able to run code under a completely specified environment. It is aimed at ensuring the right sets of packages are installed for users and workshops.
What is manifesto
?
manifesto
introduces a human-readable, TOML-based manifest format for R projects.
It captures:
- Project metadata (name, version, description, authors)
- Required R version
- Package dependencies, with version constraints
- Package sources (CRAN, Bioconductor, GitHub, GitLab, Git, or custom URLs)
- Optional dependency groups (development, workshop, full install)
- System dependencies (OS libraries)
- Install preferences (such as binary vs source installs)
The goal is to simplify project setup across local machines, teams, and workshops, without locking users into heavyweight tools.
Installation
You can install the development version of manifesto
like so:
# install.packages('pak')
pak::pak('christopherkenny/manifesto')
Example
For most users, you will only need to use the manifest_install()
function. This handles organizing and installing packages dound in the manifest file. By default, this file is called rproject.toml
.
Below, we install one of the example manifest files included with the package. Note that for the example, dry_run = TRUE
means that no packages will be installed, but details of what would be installed are printed to the console.
library(manifesto)
manifest <- system.file(package = 'manifesto', 'complex.toml')
manifest_install(path = manifest, dry_run = TRUE)
#>
#> ── Dry run: would install the following 3 packages ──
#>
#> • dplyr@>=1.0.10
#> • BiocManager@>=1.30.10
#> • readr@2.1.4
manifesto
can also be used to create a manifest file from a package’s DESCRIPTION
file.
manifest <- manifest_from_description(
path = system.file(package = 'manifesto', 'complex.toml')
)
readLines(manifest) |>
cat(sep = '\n')
#> [manifesto]
#> version = "0.0.1"
#>
#> [project]
#> name = "manifesto"
#> version = "0.0.1"
#> authors = [
#> { name = "Christopher T. Kenny", email = "christopherkenny@fas.harvard.edu", roles = ["aut", "cre"] }
#> ]
#>
#> [environment]
#> r_version = "*"
#>
#> [dependencies]
#> cli = "*"
#> jsonlite = "*"
#> pak = "*"
#> tomledit = "*"
#>
#> [suggests-dependencies]
#> knitr = "*"
#> rmarkdown = "*"
#> testthat = ">= 3.0.0"
License
This package is licensed under the MIT License.