Initialize a slushy environment
slushy_init.Rd
Set up a slushy environment in an existing project.
Usage
slushy_init(date = NULL, project = NULL, config = get_config(), restart = TRUE)
Arguments
- date
CRAN snapshot date (as string with format yyyy-mm-dd) to use for packages. If NULL, today's date will be used.
- project
The project directory. If NULL, defaults to the nearest parent directory that contains an `.Rproj` file relative to the current working directory.
- config
List of configuration options. If not provided, defaults to reading from default settings in config file included in slushy package.
- restart
Restart session after slushy is initialized? Defaults to TRUE.
Details
The following steps will be performed:
1. renv is initialized using the closest CRAN snapshot date to the one supplied. 2. Agreed upon packages (supplied in config) are installed and documented in a DESCRIPTION file. 3. Explicit snapshotting via renv is performed to capture the state of the project's library. 4. If restart=TRUE, session restarts and renv is activated for the project.
Examples
if (FALSE) { # \dontrun{
# default
slushy_init()
# pass options
slushy_init(date = "2022-08-01", config = get_config("slushy_config.yml"))
} # }