| chop_fn | R Documentation |
chop_fn() is a convenience wrapper: chop_fn(x, foo, ...)
is the same as chop(x, foo(x, ...)).
chop_fn(
x,
fn,
...,
extend = NULL,
left = TRUE,
close_end = TRUE,
raw = NULL,
drop = TRUE
)
brk_fn(fn, ...)
tab_fn(
x,
fn,
...,
extend = NULL,
left = TRUE,
close_end = TRUE,
raw = NULL,
drop = TRUE
)
x |
A vector. |
fn |
A function which returns a numeric vector of breaks. |
... |
Further arguments to |
extend |
Logical. If |
left |
Logical. Left-closed or right-closed breaks? |
close_end |
Logical. Close last break at right? (If |
raw |
Logical. Use raw values in labels? |
drop |
Logical. Drop unused levels from the result? |
chop_* functions return a factor of the same length as x.
brk_* functions return a function to create breaks.
tab_* functions return a contingency table().
Other chopping functions:
chop(),
chop_equally(),
chop_evenly(),
chop_mean_sd(),
chop_n(),
chop_proportions(),
chop_quantiles(),
chop_width(),
fillet()
if (requireNamespace("scales")) {
chop_fn(rlnorm(10), scales::breaks_log(5))
# same as
# x <- rlnorm(10)
# chop(x, scales::breaks_log(5)(x))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.