Skip to contents

Test if an object is a ggcpt object

Usage

is_ggcpt(x)

Arguments

x

An object to test.

Value

TRUE if x inherits from 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