ContDataQC
uses a configuration file (config.R) that allows for customization.
Through the use of a configuration file the user can change many of the
variables in the library used in the processing of data (e.g., the names of
fields, thresholds, and date formats).
The ContDataQC() function allows the user to input their own configuration file. Only variables that are different from the default need to be added. That is, the default configuration is loaded in the library and then the user supplied configuration. This allows the user configuration to overwrite the defaults for that session.
The Config.out will output the contents of the configuration file as used by the package and stored in the environment ContData.env.
The contents of the default configuration file (extdata/config.ORIG.R) can be
output with the Config.Out
function. An HTML (default) or DOCX report is
generated along with a text file (.r) of the configuration file.
library(ContDataQC) dn_export <- tempdir() Config.Out(fun.myDir.export = dn_export)
The config file that is generated by the Config.Out
function can be modified
to contain the custom values. Only modified values need to be included in the
custom configuration file. That is, if you only want to modify a single
variable you only need to include this single variable in your custom
configuration file.
However, there are some variables that reference the numeric and name/labels that also need to be modified. That is, if the user modifies a named variable then every time that named variable is referenced later in the config file it also has to be uncommented.
This process works because the default configuration is always loaded with the package at start up. Then any parameters specified in a custom configuration are loaded and overwrite the defaults.
The file can be edited in a text editor or in R-Studio. It is not recommended to use Word or other word processing programs.
If the user wanted to change the change the following three parameters and related thresholds then the lines referenced in the table below would also need to be modified.
"Air.BP.kpa"
"Water.BP.kpa"
"Water.Level.m"
| Item | AirBP| WaterP| SensorDepth| Other |
|----------------------------|:----:|:------:|:---------:|:-------:|
| Units | 61 | 62 | 63 | |
| Column Name | 84 | 86 | 88 | |
| Labels | 113 | 116 | 119 | |
| Discrete Name | 161 | 164 | 167 | |
| Discrete Label | 198 | 201 | 204 | |
| Data Field, Names | | | | 244:249 |
| Data Field, Labels | | | | 271:274 |
| Output Name Order | | | | 307:310 |
| Flags | 538 | 541 | 544 | |
| Thresholds, Gross, Fail | | | | 358:363 |
| Thresholds, Gross, Suspect | | | | 385:390 |
| Thresholds, Spike | | | | 413:418 |
| Thresholds, Rate of Change | | | | 442:447 |
| Thresholds, Flat | | | | 475:482 |
| Thresholds, Flat, combo | | | | 508:417 |
| Flag Labels | | | | 539:545 |
| Test Names | | | | 575 |
R code has a few conventions that the user should be aware of when making edits to the configuration file.
Any text after a "#" is treated as comments and not evaluated.
The arrow, "<-", is treated as a equal sign when assigning values to a parameter.
All parameters in the configuration file will be a part of the environment "ContData.env".
A custom configuration file should follow the format of the default configuration file. And should be saved as a ".r" file (or ".R").
The contents of the default configuration file (extdata/config.ORIG.R) are listed below. Sections are created with similar variables. Please note that the window below is narrow and some lines wrap to the next line.
fn <- file.path(system.file("extdata", "config.ORIG.R", package="ContDataQC")) cat(readLines(fn), sep="\n")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.