Learn R Programming

ruler (version 0.1.3)

row-pack: Row rule pack

Description

Row rule pack is a rule pack which defines a set of rules for rows as a whole, i.e. functions which convert rows of interest to logical values. It should return a data frame with the following properties:

  • Number of rows equals to number of checked rows.

  • Column names should be treated as rule names.

  • Values indicate whether the row as a whole follows the rule.

Arguments

Note about rearranging rows

Note that during exposure packs are applied to keyed object with id key. So they can rearrange rows as long as it is done with functions supported by keyholder. Rows will be tracked and recognized as in the original data frame of interest.

Details

This format is inspired by dplyr's transmute().

The most common way to define row pack is by creating a functional sequence containing transmute(...).

See Also

Data pack, group pack, column pack, cell pack.

Examples

Run this code
# NOT RUN {
some_row_mean_rules <- . %>% dplyr::slice(1:3) %>%
  dplyr::mutate(row_mean = rowMeans(.)) %>%
  dplyr::transmute(
    row_mean_low = row_mean > 10,
    row_mean_up = row_mean < 20
  )
all_row_sum_rules <- . %>% dplyr::mutate(row_sum = rowSums(.)) %>%
  dplyr::transmute(row_sum_low = row_sum > 30)

row_packs(
  some_row_mean_rules,
  all_row_sum_rules
)

# }

Run the code above in your browser using DataLab