data-pack {ruler} | R Documentation |
Data rule pack
Description
Data rule pack is a rule pack which defines a set of rules for data as a whole, i.e. functions which convert data to logical values. It should return a data frame with the following properties:
Number of rows equals to one.
Column names should be treated as rule names.
Values indicate whether the data as a whole follows the rule.
Details
This format is inspired by dplyr
's summarise() applied
to non-grouped data.
The most common way to define data pack is by creating a
functional sequence with no grouping and ending with
summarise(...)
.
See Also
Group pack, Column pack, row pack, cell pack.
Examples
data_dims_rules <- . %>%
dplyr::summarise(
nrow_low = nrow(.) > 10,
nrow_up = nrow(.) < 20,
ncol_low = ncol(.) > 5,
ncol_up = ncol(.) < 10
)
data_na_rules <- . %>%
dplyr::summarise(all_not_na = Negate(anyNA)(.))
data_packs(
data_nrow = data_dims_rules,
data_na = data_na_rules
)
[Package ruler version 0.3.0 Index]