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 `b`

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.

1 | ```
bin_series(series, b = NA, step = NA, bounds = NA)
``` |

`series` |
Vector of the continuously-valued time series to bin. |

`b` |
Numeric giving the desired number of uniform bins. |

`step` |
Numeric giving the desired size of each uniform bin. |

`bounds` |
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)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.