Skip to contents

This function can be used to reformat the levels produced by the santoku::lbl_dash() function.

Usage

gtl_relabel_dash(x)

Arguments

x

A string vector of labels

Value

A string vector with clean labels

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  > 13  > 13  > 13  > 13  > 13  > 13 
#> Levels: < 5 5—7 7—13 > 13