Skip to contents

The interval-valued methods (currently nsp_wrapper()) return regions rather than points: each is guaranteed to contain at least one changepoint at a prescribed global significance level. A region is a different object from a confidence interval around an estimate, so it lives in its own slot and has its own accessor rather than being folded into tidy().

Usage

cpt_regions(x)

Arguments

x

A ggcpt object.

Value

A tibble with columns start, end (positions), length, and — when the result carries a time index — start_index/end_index on the original scale. Any further columns the engine supplied are carried through after those – nsp_wrapper() adds value, the region's statistic. A zero-row tibble when the result carries no regions.

Examples

set.seed(2026)
fit <- as_ggcpt(50, c(rnorm(50), rnorm(50, 4)),
                regions = data.frame(start = 45, end = 56))
cpt_regions(fit)
#> # A tibble: 1 × 3
#>   start   end length
#>   <int> <int>  <int>
#> 1    45    56     12