Skip to contents

Compute the range of an R object, and format it as string suitable for printing.

Usage

formatted_range(x, na.rm = TRUE, digits = 3, nsmall = 2, collapse = "..")

Arguments

x

an R object

na.rm

logical, indicating if NA's should be omitted.

digits, nsmall

numeric, passed to same name parameters of format().

collapse

character, passed to same name parameter of paste().

See also

Examples

formatted_range(c(1, 3.5, -0.01))
#> [1] "-0.01..3.50"