Skip to content

dependencies

This is the main element of the config file and is most commonly edited. It specifies which packages (or project dependencies) to install in your project, as well additional options to tune the installation.

There are 4 types of dependency configurations, sorted by their source, each of which have individual configurations corresponding with them.

All dependencies types have the following configurations:

  • install_suggestions optional - Install the suggested dependencies of the package

    Default: false

  • dependencies_only optional - Install only the dependencies of the package, not the package itself. Used primarily for package development.

    Default: false

The most common/default type. These packages will be sourced from the CRAN-like repositories listed in the repositories section, preferring binaries unless otherwise specified.

A simple string can be listed if no configuration required for the package. These packages will be installed from the first resolvable repository.

  • name - The name of the package
  • repository optional - Used to specify that a package must come from a specific repository by indicating an alias corresponding to the repositories section

    Default: first resolvable repository

  • force_source optional - Force the package to be fetched as source

    Default: false

dependencies = [
"dplyr",
{ name = "purrr", force_source = true },
{ name = "ggplot2", repository = "CRAN" },
{ name = "tibble", force_source = true, repository = "PPM" },
]

Used to install packages from a git repository from either a branch, tag, or commit reference. Requires the git CLI to be available.

  • name - The name of the package. Must match the name of the package found in the repository
  • git - The git repository url. Either http or SSH
  • tag or branch or commit - Must specify one and only one git reference. commit must be the full git sha.
  • directory optional - a (sub)directory inside of the repository containing the R package, if the package is not at the repository root.

    Default: None

dependencies = [
{ name = "git-tag", git = "https://github.com/a2-ai/git-tag", tag = "v1.0.0" },
{ name = "git-commit", git = "https://github.com/a2-ai/git-commit", commit = "bc50e550e432c3c620714f30dd59115801f89995" },
{ name = "git-branch", git = "https://github.com/a2-ai/git-branch", branch = "main", directory = "r" },
]

Install a package from a local source. Can be a directory or archive containing a source or binary R package.

  • name - The name of the package. Must match the name of the package found at the path.
  • path - The path pointing to the package directory or archive
dependencies = [
{ name = "local-dir", path = "path/to/my/package", dependencies_only = true },
{ name = "local-archive", path = "path/to/my/archive.tar.gz" },
]

Install a source or binary package directly from a URL.

  • name - The name of the package. Must match the name of the package found at the url.
  • url - The url pointing to the package archive from which to download.
{ name = "dplyr", url = "https://cran.r-project.org/src/contrib/Archive/dplyr/dplyr_1.1.3.tar.gz" },