Learn R Programming

DCC (version 1.2.1)

dcc_config: A cleaning configuration

Description

Bundles a rule set, an action map, a record-id column, and the item columns into a single object that dcc_run consumes.

Usage

dcc_config(rules, actions = list(), id_var = NULL, items = NULL)

Value

A dcc_config object.

Arguments

rules

A dcc_ruleset from dcc_rules.

actions

Named list mapping check_ids to actions (see dcc_execute).

id_var

Record-id column name, or NULL for row numbers.

items

Optional character vector of item column names.

See Also

dcc_run, dcc_validate_config.

Examples

Run this code
rf <- tempfile(fileext = ".yaml")
writeLines(c("checks:", "  - id: R001", "    type: range",
             "    variable: score", "    min: 0", "    max: 100"), rf)
if (requireNamespace("yaml", quietly = TRUE)) {
  dcc_config(dcc_rules(rf), actions = list(R001 = "set_na"), id_var = "sid")
}

Run the code above in your browser using DataLab