rwe_cut | R Documentation |
Cut a sequence of numbers into bins.
The cut points are chosen such that there will with equal numbers in each bin
for x
. By default, values of y
that are outside the range of
x
will be excluded from the bins, unless they are in the
keep_inx
.
rwe_cut(x, y = x, breaks = 5, keep_inx = NULL)
x |
Vector of values based on which cut points will be determined |
y |
Vector of values to be cut, default to be the same as |
breaks |
Number of cut points |
keep_inx |
Indices of y that will be categorized as 1 or the largest bin even if their values are out of range of x, i.e. the y's that will not be trimmed |
A vector of stratum assignment for y
. The y's that are outside
the range of x
and not in keep_inx
are assigned NA
in the result.
x <- rnorm(100, mean = 0, sd = 1) y <- rnorm(1000, mean = 1, sd = 2) rwe_cut(x, y, breaks = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.