
Last chance! 50% off unlimited learning
Sale ends in
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.
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(...)
.
# NOT RUN {
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
)
# }
Run the code above in your browser using DataLab