row-pack {ruler}R Documentation

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:

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(...).

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.

See Also

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

Examples

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
)

[Package ruler version 0.3.0 Index]