This uses the midpoint of each interval for its label.
Arguments
- fmt
String, list or function. A format for break endpoints.
- single
Glue string: label for singleton intervals. See
lbl_glue()
for details.- first
Glue string: override label for the first category. Write e.g.
first = "<{r}"
to create a label like"<18"
. Seelbl_glue()
for details.- last
String: override label for the last category. Write e.g.
last = ">{l}"
to create a label like">65"
. Seelbl_glue()
for details.- raw
. Use the
raw
argument tochop()
instead.
Formatting endpoints
If fmt
is not NULL
then it is used to format the endpoints.
If
fmt
is a string, then numeric endpoints will be formatted bysprintf(fmt, breaks)
; other endpoints, e.g. Date objects, will be formatted byformat(breaks, fmt)
.If
fmt
is a list, then it will be used as arguments to format.If
fmt
is a function, it should take a vector of numbers (or other objects that can be used as breaks) and return a character vector. It may be helpful to use functions from the{scales}
package, e.g.scales::label_comma()
.
See also
Other labelling functions:
lbl_dash()
,
lbl_discrete()
,
lbl_endpoints()
,
lbl_glue()
,
lbl_intervals()
,
lbl_manual()
,
lbl_seq()