Skip to contents

Separate groups of measures into different flat tables. For each group we must indicate a name. If we indicate more names than groups of measures, the measures not included in other groups are also included in a new group.

Usage

separate_measures(ft, measures, names, na_rm)

# S3 method for flat_table
separate_measures(ft, measures = NULL, names = NULL, na_rm = TRUE)

Arguments

ft

A flat_table object.

measures

A list of string vectors, groups of measure names.

names

A list of string, measure group names.

na_rm

A boolean, remove rows from output where all measure values are NA.

Value

A list of flat_table objects.

Details

A list of flat tables is returned. It assign the names to the result list.

Examples


lft <- flat_table('iris', iris) |>
  separate_measures(
    measures = list(
      c('Petal.Length'),
      c('Petal.Width'),
      c('Sepal.Length')
    ),
    names = c('PL', 'PW', 'SL', 'SW')
  )