tab(1:10, c(1, 3, 3, 7),
labels = lbl_glue("{l} to {r}", single = "Exactly {l}"))
tab(1:10 * 1000, c(1, 3, 5, 7) * 1000,
labels = lbl_glue("{l}-{r}",
fmt = function(x) prettyNum(x, big.mark=',')))
# reproducing lbl_intervals():
interval_left <- "{ifelse(l_closed, '[', '(')}"
interval_right <- "{ifelse(r_closed, ']', ')')}"
glue_string <- paste0(interval_left, "{l}", ", ", "{r}", interval_right)
tab(1:10, c(1, 3, 3, 7), labels = lbl_glue(glue_string, single = "{{{l}}}"))
Run the code above in your browser using DataLab