Skip to contents

For each comma seperated value in a cell a new row is added.

Usage

statstable_expand(statstable, sep = "\\s*,\\s*")

Arguments

statstable

compact statstable

sep

seperator of combined values

Value

expanded statstable

See also

  • tidyr::seperate_rows() is used to expand the table. One call per column.

Examples

statstable <- tibble::tribble(
  ~parameter, ~statistic, ~from, ~to,
  "O3, NO2", "min, max", "h1, d1", "m1, y1"
)
statstable_expand(statstable)
#> # A tibble: 16 × 4
#>    parameter statistic from  to   
#>    <chr>     <chr>     <chr> <chr>
#>  1 O3        min       h1    m1   
#>  2 O3        min       h1    y1   
#>  3 O3        min       d1    m1   
#>  4 O3        min       d1    y1   
#>  5 O3        max       h1    m1   
#>  6 O3        max       h1    y1   
#>  7 O3        max       d1    m1   
#>  8 O3        max       d1    y1   
#>  9 NO2       min       h1    m1   
#> 10 NO2       min       h1    y1   
#> 11 NO2       min       d1    m1   
#> 12 NO2       min       d1    y1   
#> 13 NO2       max       h1    m1   
#> 14 NO2       max       h1    y1   
#> 15 NO2       max       d1    m1   
#> 16 NO2       max       d1    y1