formatBreaks | R Documentation |
cut
Helper for more readable labels when use with cut
formatBreaks( brks, inbetween_sep = "-", prefix_first = "< ", prefix_last = "> ", suffix_first = "", suffix_last = "" )
brks |
numeric vector that will be used to |
inbetween_sep, prefix_first, prefix_last, suffix_first, suffix_last |
strings that are put in between intervals, at the beginning or at the intervals only. |
a character string
cont_var <- rnorm (100) * 100 brks <- pretty(cont_var, n = 10) # or range(cont_var) %>% pretty() brks_labels <- formatBreaks(brks, inbetween_sep = ' - ') formatBreaks(brks, inbetween_sep = ' - ', suffix_first = " unité") cut(cont_var, breaks = brks, labels = brks_labels)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.