interval {wakefield} | R Documentation |
Cut Numeric Into Factor
Description
A wrapper for cut
that cuts the vector and then adds the
varname
produced by the original function.
Usage
interval(
fun,
breaks,
...,
labels = NULL,
include.lowest = FALSE,
right = TRUE,
dig.lab = 3,
ordered_result = FALSE,
n
)
Arguments
fun |
A vector producing function. |
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 the vector produced from |
labels |
Labels for the levels of the resulting category. By default,
labels are constructed using "(a,b]" interval notation. If
|
include.lowest |
logical. If |
right |
logical. If |
dig.lab |
An integer which is used when labels are not given. It determines the number of digits used in formatting the break numbers. |
ordered_result |
logical. If |
n |
The number elements to generate. This can be globally set within
the environment of |
... |
Other arguments passed to |
Value
Returns a cut
factor vector.
See Also
Examples
interval(normal, 4, n=100)
attributes(interval(normal, 4, n=100))
interval(age, 3, n = 1000)