Learn R Programming

ProjectTemplate (version 0.11.0)

project.config: ProjectTemplate Configuration file

Description

Every ProjectTemplate project has a configuration file found at config/global.dcf that contains various options that can be tweaked to control runtime behavior. The valid options are shown below, and must be encoded using the DCF format.

Usage

project.config()

Arguments

Value

The current project configuration is displayed.

Details

Calling the project.config() function will display the current project configuration.

The options that can be configured in the config/global.dcf are shown below

data_loadingThis can be set to TRUE or FALSE. If data_loading is on, the system will load data from both the cache and data directories with cache taking precedence in the case of name conflict.
data_loading_headerThis can be set to TRUE or FALSE. If data_loading_header is on, the system will load text data files, such as CSV, TSV, or XLSX, treating the first row as header.
data_ignoreA comma separated list of files to be ignored when importing from the data/ directory. Regular expressions can be used but should be delimited (on both sides) by /. Note that filenames and filepaths should never begin with a /, entire directories under data/ can be ignored by adding a trailing /.
cache_loadingThis can be set to TRUE or FALSE. If cache_loading is on, the system will load data from the cache directory before any attempt to load from the data directory.
recursive_loadingThis can be set to TRUE or FALSE. If recursive_loading is on, the system will load data from the data directory and all its sub directories recursively.
mungingThis can be set to TRUE or FALSE. If munging is on, the system will execute the files in the munge directory sequentially using the order implied by the sort() function. If munging is FALSE, none of the files in the munge directory will be executed.
loggingThis can be set to TRUE or FALSE. If logging is on, a logger object using the log4r package is automatically created when you run load.project(). This logger will write to the logs directory.
logging_levelThe value of logging_level is passed to a logger object using the log4r package during logging when when you run load.project().
load_librariesThis can be set to TRUE or FALSE. If load_libraries is on, the system will load all of the R packages listed in the libraries field described below.
librariesThis is a comma separated list of all the R packages that the user wants to automatically load when load.project() is called. These packages must already be installed before calling load.project().
as_factorsThis can be set to TRUE or FALSE. If as_factors is on, the system will convert every character vector into a factor when creating data frames; most importantly, this automatic conversion occurs when reading in data automatically. If FALSE, character vectors will remain character vectors.
tables_typeThis is the format for default tables. Values can be 'tibble' (default), 'data_table', or 'data_frame'
attach_internal_librariesThis can be set to TRUE or FALSE. If attach_internal_libraries is on, then every time a new package is loaded into memory during load.project() a warning will be displayed informing that has happened.
cache_loaded_dataThis can be set to TRUE or FALSE. If cache_loaded_data is on, then data loaded from the data directory during load.project() will be automatically cached (so it won't need to be reloaded next time load.project() is called).
sticky_variablesThis is a comma separated list of any project-specific variables that should remain in the global environment after a clear() command. This can be used to clear the global environment, but keep any large datasets in place so they are not unnecessarily re-generated during load.project(). Note that any this will be over-ridden if the force=TRUE parameter is passed to clear()`.
underscore_variablesThis can be set to TRUE to use underscores ('_') in variable names or FALSE to replace underscores ('_') with dots ('.'). The default is TRUE. When migrating old projects, underscore_variables is set to FALSE.
cache_file_formatThe default file format for cached data is 'RData'. This can be set to 'qs' in order to benefit from the quick serialization of R objects provided by qs.

If the config/globals.dcf is missing some items (for example because it was created under an old version of ProjectTemplate, then the following configuration is used for any missing items during load.project(): ProjectTemplate:::.format.config(ProjectTemplate:::.default.config[-1], format="Rd")

When a new project is created using create.project(), the following values are pre-populated: ProjectTemplate:::.format.config(ProjectTemplate:::.new.config, format="Rd")

See Also

load.project