cut_inclusive {tidychangepoint}R Documentation

Use a changepoint set to break a time series into regions

Description

Use a changepoint set to break a time series into regions

Usage

cut_inclusive(x, tau)

split_by_tau(x, tau)

Arguments

x

A numeric vector

tau

a numeric vector of changepoint indices

Details

A changepoint set tau of length k breaks a time series of length n into k+1 non-empty regions. These non-empty regions can be defined by half-open intervals, starting with 1 and ending with n+1.

cut_inclusive() splits a set of indices into a base::factor() of half-open intervals

split_by_tau() splits a time series into a named base::list() of numeric vectors

Value

Examples

n <- length(CET)

# Return a factor of intervals
cut_inclusive(1:n, tau = pad_tau(c(42, 81, 330), n))

# Return a list of observations
split_by_tau(DataCPSim, c(365, 826))


[Package tidychangepoint version 0.0.1 Index]