Provides 'TOML' representations of packages needed that must be installed to run a project. Includes functions to specify detailed installation functions, validate files, and to use a given file as the requirements for a project. Handles package installations, when necessary, via 'pak'.
manifesto 
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.
manifesto?manifesto introduces a human-readable, TOML-based manifest format for
R projects. It captures:
The goal is to simplify project setup across local machines, teams, and workshops, without locking users into heavyweight tools.
The smallest valid rproject.toml looks like this:
[project]
name = "MyAnalysis"
version = "0.0.1"
[manifesto]
version = "0.1.0"
[environment]
r_version = ">= 4.4.2"
[dependencies]
dplyr = ">= 1.0.0"
You can install the development version of manifesto like so:
# install.packages('pak')
pak::pak('christopherkenny/manifesto')
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 ──
#>
#> • [email protected]
#> • [email protected]
#> • [email protected]
manifesto can also be used to create a manifest file from a package’s
DESCRIPTION file.
manifest <- manifest_from_description(
system.file(package = 'cli', 'DESCRIPTION')
)
readLines(manifest) |>
cat(sep = '\n')
#> [manifesto]
#> version = "0.0.1"
#>
#> [project]
#> name = "cli"
#> version = "3.6.5"
#> authors = [
#> { name = "Gábor Csárdi", email = "[email protected]", roles = ["aut", "cre"] },
#> { name = "Hadley Wickham", roles = "ctb" },
#> { name = "Kirill Müller", roles = "ctb" },
#> { name = "Salim Brüggemann", email = "[email protected]", roles = "ctb" },
#> { name = "Posit Software, PBC", roles = ["cph", "fnd"] }
#> ]
#>
#> [environment]
#> r_version = ">= 3.4"
#>
#> [dependencies]
#> utils = "*"
#>
#> [suggests-dependencies]
#> callr = "*"
#> covr = "*"
#> crayon = "*"
#> digest = "*"
#> glue = ">= 1.6.0"
#> grDevices = "*"
#> htmltools = "*"
#> htmlwidgets = "*"
#> knitr = "*"
#> methods = "*"
#> processx = "*"
#> ps = """
#> >=
#> 1.3.4.9000"""
#> rlang = ">= 1.0.2.9003"
#> rmarkdown = "*"
#> rprojroot = "*"
#> rstudioapi = "*"
#> testthat = ">= 3.2.0"
#> tibble = "*"
#> whoami = "*"
#> withr = "*"