bin | R Documentation |
.bincode()
When x
is an integer vector, bin()
is cheaper than .bincode()
as
no coercion to a double vector occurs. This alternative also has more
arguments that allow you to return the start values of the binned vector,
as well as including out-of-bounds intervals.
bin(
x,
breaks,
left_closed = TRUE,
include_endpoint = FALSE,
include_oob = FALSE,
codes = TRUE
)
x |
A numeric vector. |
breaks |
A numeric vector of breaks. |
left_closed |
Should intervals be left-closed (and right-open)?
Default is |
include_endpoint |
Equivalent to |
include_oob |
Should out-of-bounds interval be included?
Default is |
codes |
Should an integer vector indicating which bin the values
fall into be returned? Default is |
Either an integer vector of codes indicating which bin the values fall into, or the start of the intervals for which each value falls into.
get_breaks as_discrete
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.