changepoint::cpt
and strucchange::breakpoints
to data.frame
R/fortify_changepoint.R
fortify.cpt.Rd
Convert changepoint::cpt
and strucchange::breakpoints
to data.frame
# S3 method for class 'cpt'
fortify(model, data = NULL, is.date = NULL, ...)
chantepoint::cpt
or strucchange::breakpoints
instance
original dataset, if needed
Logical frag indicates whether the stats::ts
is date or not.
If not provided, regard the input as date when the frequency is 4 or 12.
other arguments passed to methods
data.frame
if (FALSE) { # \dontrun{
library(changepoint)
fortify(cpt.mean(AirPassengers))
fortify(cpt.var(AirPassengers))
fortify(cpt.meanvar(AirPassengers))
library(strucchange)
bp.nile <- breakpoints(Nile ~ 1)
fortify(bp.nile)
fortify(breakpoints(bp.nile, breaks = 2))
fortify(breakpoints(bp.nile, breaks = 2), data = Nile)
} # }