fillet {santoku} | R Documentation |
Chop data precisely (for programmers)
Description
fillet()
calls chop()
with extend = FALSE
and drop = FALSE
. This
ensures that you get only the breaks
and labels
you ask for. When
programming, consider using fillet()
instead of chop()
.
Usage
fillet(
x,
breaks,
labels = lbl_intervals(),
left = TRUE,
close_end = TRUE,
raw = NULL
)
Arguments
x |
A vector. |
breaks |
A numeric vector of cut-points or a function to create
cut-points from |
labels |
A character vector of labels or a function to create labels. |
left |
Logical. Left-closed or right-closed breaks? |
close_end |
Logical. Close last break at right? (If |
raw |
Logical. Use raw values in labels? |
Value
fillet()
returns a factor
of the same length as x
, representing
the intervals containing the value of x
.
See Also
Other chopping functions:
chop()
,
chop_equally()
,
chop_evenly()
,
chop_fn()
,
chop_mean_sd()
,
chop_n()
,
chop_proportions()
,
chop_quantiles()
,
chop_width()
Examples
fillet(1:10, c(2, 5, 8))
[Package santoku version 1.0.0 Index]