knitr::opts_chunk$set( comment = "#>", tidy = FALSE, error = FALSE, fig.width = 8, fig.height = 8)
Persistent Package Configuration
Store the configuration of your package in the user's platform dependent config file directory. The configuration persists across R sessions, and can also be edited manually. Configuration files are YAML files.
Once on CRAN, install the package with:
install.packages("conf")
library(conf)
conf
uses the rappdirs
package (https://github.com/hadley/rappdirs) to
determine the appropriate location of the configuration file of a package.
To determine the location of the configuration file, you can use:
conf$new(package = "mypackage")$get_path()
Create a configuration file by creating a conf
object, then setting
some configuration keys in it, and writing it out to a file:
cf <- conf$new(package = "mypackage", lock = TRUE)
cf <- conf$new(file = tempfile(), lock = TRUE)
cf$set("user:id", "test-user") cf$set("user:email", "test@acme.com") cf$set("rversion", format(getRversion()))
cf
cf$save()
MIT © RStudio Inc
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.