Get interval labels for even intervals of discrete numeric values compatible with base::cut.
interval_labels(from, to, width = 5)
A numeric value for the beginning and the end of the interval.
numeric value
The width of the interval, e.g. 5 (default) for intervals 0-5.
A character vector of interval labels compatible with base::cut.
character
# NOT RUN { x <- round(runif(100, 0, 100), 0) labels <- interval_labels(0, 100, 10) cut(x, breaks = seq(0, 100, 10), labels = labels) # }
Run the code above in your browser using DataCamp Workspace