| ruleset | R Documentation |
Creates a set of rules
ruleset(..., data_columns = NULL, meta = NULL, data_name = NULL)
## S3 method for class 'ruleset'
print(x, n = 3, ...)
... |
a list of rules |
data_columns |
optional list of schema declarations created with
internal |
meta |
optional metadata list for v1 YAML workflows. |
data_name |
optional name of the primary dataset when |
x |
a ruleset to print |
n |
a maximum number of rules to print |
the list of rules as a ruleset
print(ruleset): Prints a ruleset
r1 <- rule(mpg > 10)
r2 <- rule(mpg < 20)
rs <- ruleset(r1, r2)
rs
rs <- ruleset(
rule(cyl %in% c(4, 6, 8)),
rule(is.numeric(disp))
)
rs
# combine row, schema, and relational checks
orders <- data.frame(order_id = 1:4, customer_id = c(10, 11, 99, NA), amount = c(10, 20, -5, 30))
customers <- data.frame(customer_id = c(10, 11, 12))
rs2 <- ruleset(
rule(amount >= 0, name = "amount must be non-negative"),
reference_rule(
local_col = "customer_id",
ref_dataset = "customers",
ref_col = "customer_id",
allow_na = TRUE
),
data_columns = list(
data_column("order_id", type = "int", optional = FALSE),
data_column("customer_id", type = "int", optional = FALSE),
data_column("amount", type = "double", optional = FALSE)
),
data_name = "orders"
)
check_data(list(orders = orders, customers = customers), rs2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.