| cpt_batch | R Documentation |
Runs one detector over every series in a collection: the panel-data loop
that methodological and applied work both need constantly. Accepts a
matrix/data frame (one column per series) or a named list of numeric
vectors. Honours future::plan() for parallel execution when the
future.apply package is available, with parallel-safe RNG.
cpt_batch(
x,
method = "pelt",
change_in = "mean",
index = NULL,
seed = NULL,
keep_fit = TRUE,
...
)
## S3 method for class 'ggcpt_batch'
print(x, ...)
## S3 method for class 'ggcpt_batch'
tidy(x, ...)
## S3 method for class 'ggcpt_batch'
autoplot(object, ...)
x |
For |
method |
Detection method, passed to |
change_in |
What to detect change in, passed to
|
index |
Optional time index shared by every series in the panel (a
vector of dates, say), or a named list of one index per series. A list
has to cover every series, with indices of one type, because
|
seed |
Optional seed for reproducible parallel execution (passed to
|
keep_fit |
Keep each engine's raw fit in |
... |
Additional arguments passed to every |
object |
A |
A ggcpt_batch object: a tibble with one row per series and
columns series, n_changepoints, changepoints (a
list-column of tidy tibbles), and result (a list-column of
ggcpt objects). Methods: print(), tidy() (one row
per changepoint across all series, with columns series,
cp and cp_value), and autoplot() (faceted
small-multiples with each series' changepoints).
set.seed(2026)
X <- cbind(a = c(rnorm(60), rnorm(60, 4)), b = rnorm(120))
batch <- cpt_batch(X, method = "pelt")
batch
tidy(batch)
ggplot2::autoplot(batch)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.