View source: R/interval_utils.R
| check_zero_width_intervals | R Documentation |
Checks whether interval-valued data contains any zero-width
intervals (min == max). Such degenerate intervals break downstream
tools that divide by interval width (e.g.
ggInterval::ggInterval_indexImage()). The input may be supplied either
in MM format (a data.frame with paired _min/_max columns)
or in RSDA format (a symbolic_tbl with symbolic_interval
columns).
check_zero_width_intervals(data, tol = 0, warn = TRUE)
data |
Interval-valued data, in one of two accepted formats:
|
tol |
Non-negative numeric tolerance. An interval is flagged when
|
warn |
Logical; if |
Invisibly, a logical scalar: TRUE if any zero-width interval
is present, otherwise FALSE. The returned value carries two attributes:
"flagged", a logical [n, p] matrix marking each zero-width cell
(rows = concepts, columns = interval variables), and "variables", the
names of variables containing at least one zero-width interval.
# MM format (paired _min/_max columns)
data(mushroom.int.mm)
check_zero_width_intervals(mushroom.int.mm)
# RSDA format (symbolic_tbl)
data(mushroom.int)
check_zero_width_intervals(mushroom.int)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.