| range_spec | R Documentation |
Helper function to create range specifications for numeric formats.
range_spec(low, high, label, inc_low = TRUE, inc_high = FALSE)
low |
Numeric. Lower bound of the range. |
high |
Numeric. Upper bound of the range. |
label |
Character. Label for values in this range. |
inc_low |
Logical. If |
inc_high |
Logical. If |
By default, ranges are half-open: [low, high) — the lower bound is
included and the upper bound is excluded. This matches 'SAS' PROC FORMAT
range semantics and prevents overlap between adjacent ranges.
A range_spec object (list with low, high, label, inc_low, inc_high).
range_spec(0, 18, "Child") # [0, 18)
range_spec(18, 65, "Adult") # [18, 65)
range_spec(65, Inf, "Senior", inc_high = TRUE) # [65, Inf]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.