This function can be used to reformat the levels produced
by the santoku::lbl_dash() function.
Examples
data <- seq(1, 20)
data_cut <- santoku::chop(data,
breaks = c(5, 7, 13),
labels = santoku::lbl_dash(),
extend = TRUE, drop = FALSE
)
forcats::fct_relabel(data_cut, gtl_relabel_dash)
#> [1] -∞—5 -∞—5 -∞—5 -∞—5 5—7 5—7 7—13 7—13 7—13 7—13 7—13 7—13 13—∞ 13—∞ 13—∞
#> [16] 13—∞ 13—∞ 13—∞ 13—∞ 13—∞
#> Levels: -∞—5 5—7 7—13 13—∞
