Skip to contents

Verify the integrity of the row groups object

Usage

verify_row_groups(row_groups, row_info)

Arguments

row_groups

A data frame describing of how to group the rows in row_info. Can consist of the following columns:

  • group (character): The corresponding group in row_info$group.

  • level1 (character): The label at the highest level.

  • level2 (character, optional): The label at the middle level.

  • level3 (character, optional): The label at the lowest level (not recommended).

row_info

A data frame describing the rows of data. This data should contain two columns:

  • id (character): Corresponds to the column data$id.

  • group (character): The group of the row. If all are NA, the rows will not be split up into groups.

Value

The row groups object with all expected rows.

Examples

library(tibble)
row_groups <- tribble(
  ~group, ~level1,
  "foo", "Foo",
  "bar", "Bar"
)
row_info <- tribble(
  ~id, ~group,
  "name", NA_character_,
  "foo1", "foo",
  "foo2", "foo",
  "bar1", "bar",
  "bar2", "bar"
)
verify_row_groups(row_groups, row_info)
#> # A tibble: 2 × 2
#>   group level1
#>   <chr> <chr> 
#> 1 foo   Foo   
#> 2 bar   Bar