A class check, useful when a function accepts either a detection result or
the raw series. It tests for ggcpt in the class vector, so a
genuine ggcpt subclass (ggcpt_consensus is the one)
returns TRUE. The other ggcpt_* classes in the package
(ggcpt_batch, ggcpt_benchmark, ggcpt_monitor,
ggcpt_selection and the rest) are not subclasses of
ggcpt (most are tibble subclasses) and return
FALSE.
See also
Other result class:
annotate_segments(),
as_cpt_series(),
as_ggcpt(),
cpt_annotations(),
new_ggcpt(),
print.ggcpt()
Examples
set.seed(2026)
fit <- cpt_detect(c(rnorm(40), rnorm(40, 4)), method = "pelt")
is_ggcpt(fit)
#> [1] TRUE
is_ggcpt(fit$changepoints)
#> [1] FALSE
