Set a configuration parameter, for the package we are calling from. If called from the R prompt and not from a package, then it sets the parameter for global environment.

set_config(...)

Arguments

...

Parameters to set, they should be all named.

Value

Unlike pkgconfig::set_config(), invisibly returns the previous values of all the parameters changed, similar to options(). This allows previous values to be stored in a variable and restored later.

See also

Examples

#> [1] "three times"
default_adv <- set_config("nombre::thrice" = TRUE) nom_adv(3)
#> [1] "thrice"
nom_card(c(-1, 1e4))
#> [1] "negative one" "ten thousand"
default_card <- set_config("nombre::max_n" = 100, "nombre::negative" = "minus") nom_card(c(-1, 1e4))
#> [1] "minus one" "10000"
#> [1] "quarter"
default_denom <- set_config("nombre::quarter" = FALSE) nom_denom(4)
#> [1] "fourth"
set_config(default_adv, default_card, default_denom) nom_adv(3)
#> [1] "three times"
nom_card(c(-1, 1e4))
#> [1] "negative one" "ten thousand"
#> [1] "quarter"