Description Usage Arguments See Also Examples
This is a copy of the original base::cut.default
function which uses the
additional parameters format_fun
and ...
to apply custom formatting to
the input. By default it behaves exactly like base::cut.default
1 2 |
x |
a numeric vector which is to be converted to a factor by cutting. |
breaks |
either a numeric vector of two or more unique cut points or a
single number (greater than or equal to 2) giving the number of
intervals into which |
labels |
labels for the levels of the resulting category. By default,
labels are constructed using |
include.lowest |
logical, indicating if an ‘x[i]’ equal to
the lowest (or highest, for |
right |
logical, indicating if the intervals should be closed on the right (and open on the left) or vice versa. |
dig.lab |
integer which is used when labels are not given. It determines the number of digits used in formatting the break numbers. |
ordered_result |
logical: should the result be an ordered factor? |
format_fun |
formatting function |
... |
additional arguments passed to |
base::cut
1 2 3 4 5 6 | set.seed(1)
Z <- 1000*stats::rnorm(10000)
table(cutf(Z, c(-10005, -5000, 100, 0, 50, 10000)))
table(cutf(Z, c(-10005, -5000, 100, 0, 50, 10000), format_fun = format))
table(cutf(Z, c(-10005, -5000, 100, 0, 50, 10000), format_fun = signif2))
table(cutf(Z, c(-10005, -5000, 100, 0, 50, 10000), format_fun = format_metric))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.