interval_labels: Convert numeric or interval cuts to simple and pretty labels.

View source: R/interval_labels.R

interval_labelsR Documentation

Convert numeric or interval cuts to simple and pretty labels.

Description

Convert numeric or interval cuts to simple and pretty labels.

Usage

interval_labels(cuts, digits = NULL, left_closed = TRUE)

Arguments

cuts

A vector or numeric or character interval cuts.

left_closed

If cuts are numeric, TRUE or FALSE of whether intervals are to be left-closed. Defaults to TRUE.

format

A function to apply to the numeric values, e.g. scales::label_comma().

Value

A vector of character labels.

Examples

simplevis:::interval_labels(c(0, 0.1, 3, 4.1, 7, 100, Inf))

simplevis:::interval_labels(c("(0, 10]", "(10, 50]", "(50, 100]"))

simplevis:::interval_labels(c("[0, 10)", "[10, 50)", "[50, 100)"))


simplevis documentation built on May 31, 2023, 7:02 p.m.