Description Usage Arguments Value Examples
Bin a continuously-valued times series. The binning can be performed in any
one of three ways. The first is binning the time series into
uniform bins (with
b an integer). The second type of binning produces
bins of a specific size
step. The third type of binning breaks the
real number line into segments with specified boundaries or thresholds, and
the time series is binned according to this partitioning. The bounds are
expected to be provided in ascending order.
bin_series(series, b = NA, step = NA, bounds = NA)
Vector of the continuously-valued time series to bin.
Numeric giving the desired number of uniform bins.
Numeric giving the desired size of each uniform bin.
Vector of the finite bounds of each bin.
List giving the binned sequence, the number of bins and either the bin sizes or bin bounds.
1 2 3 4 5 6 7 8 9 10
# First method: bin into uniform bins xs <- runif(20, 0, 5) bin_series(xs, b = 5) # Second method: bins of specific size <step> bin_series(xs, step = 1) # Third method: bins of specific size <step> bounds <- c(2.0, 5.0) bin_series(xs, bounds = bounds)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.