changepoints | R Documentation |
Retrieve the indices of the changepoints identified by an algorithm or model.
changepoints(x, ...)
## Default S3 method:
changepoints(x, ...)
## S3 method for class 'mod_cpt'
changepoints(x, ...)
## S3 method for class 'seg_basket'
changepoints(x, ...)
## S3 method for class 'seg_cpt'
changepoints(x, ...)
## S3 method for class 'tidycpt'
changepoints(x, use_labels = FALSE, ...)
## S3 method for class 'ga'
changepoints(x, ...)
## S3 method for class 'cpt'
changepoints(x, ...)
## S3 method for class 'wbs'
changepoints(x, ...)
x |
A tidycpt, |
... |
arguments passed to methods |
use_labels |
return the time labels for the changepoints instead of the indices. |
tidycpt objects, as well as their segmenter
and model
components,
implement changepoints()
methods.
Note that this function is not to be confused with wbs::changepoints()
,
which returns different information.
For the default
method, changepoints()
will attempt to return the
cpt_true
attribute, which is set by test_set()
.
a numeric vector of changepoint indices, or, if use_labels
is
TRUE
, a character
of time labels.
wbs::changepoints()
Other tidycpt-generics:
as.model()
,
as.segmenter()
,
diagnose()
,
fitness()
,
model_name()
cpts <- segment(DataCPSim, method = "ga", maxiter = 5)
changepoints(cpts$segmenter)
cpts <- segment(DataCPSim, method = "wbs")
changepoints(cpts$segmenter)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.