knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%",
  eval = TRUE
)

config

CRAN status CRAN RStudio mirror downloads R-CMD-check Codecov test coverage

The config package makes it easy to manage environment specific configuration values. For example, you might want to use distinct values for development, testing, and production environments.

Installation

You can install the config package from CRAN by using:

install.packages("config")

Usage

To use config, create a file config.yml with default as well as other arbitrary configurations. For example:

```{yaml output.var="config_yaml"} default: trials: 5 dataset: "data-sampled.csv"

production: trials: 30 dataset: "data.csv"

To read configuration values you call the `config::get` function, which returns a list containing all of the values for the currently active configuration:

```r
config <- config::get()
config$trials
config$dataset

You can also read a single value from the configuration as follows:

config::get("trials")
config::get("dataset")

The config::get() function takes an optional config argument which determines which configuration to read values from (the "default" configuration is used if none is specified).

Vignettes

See the package vignettes at https://rstudio.github.io/config/ for more examples and instructions for advanced usage, including:




rstudio/config documentation built on April 4, 2024, 6:27 a.m.