Configuration

There are two types of configuration:

Both types are stored in the config object accessible from the global environment. The function project.config() will display the current configuration, including project specific configuration.

ProjectTemplate configuration

The current ProjectTemplate configuration settings exist in the config/global.dcf file:

Project specific configuration

The project specific configuration is specified in the lib/globals.R file using the add.config function. This will contain whatever is relevant for your project, and will look something like this:

> add.config(
    keep_data = FALSE,                # should temporary data be kept?
    header = "Private & Confidential" # header in reports
  )

Note that commas need to be present after each config item except the last. Comments can also be inserted to document what each config variable does. To use project specific configuaration in any lib, munge or src script, simply use the form config$keep_data. ProjectTemplate will automatically load project specific content in lib/globals.R before any other file in lib, so the filename should not be changed. The add.config() function can also be used anywhere in the project. So if a particular analysis in src wanted to override the value in globals.R, you can simply add the relevant add.config() command to the top of that script.