A generic and several implementations for binning vectors.
1 2 3 4 5 6 7 8 9 10 11 | bin_vector(x, weight = NULL, ...)
## S3 method for class 'numeric'
bin_vector(x, weight = NULL, ..., width = NULL,
center = NULL, boundary = NULL, closed = c("right", "left"),
pad = TRUE)
## S3 method for class 'POSIXct'
bin_vector(x, weight = NULL, ..., width = NULL,
center = NULL, boundary = NULL, closed = c("right", "left"),
pad = TRUE)
|
x |
a vector to bin |
weight |
if specified, an integer vector of the same length as |
... |
additional arguments passed through to instances of the generic |
width |
the width of a bin |
center |
the center of a bin |
boundary |
the boundary of a bin. |
closed |
One of |
pad |
a logical indicatign whether the bins should be padded to include an empty bin on each side. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.