autoplot.breakpoints: Autoplot 'strucchange::breakpoints'

Description Usage Arguments Value Examples

View source: R/fortify_changepoint.R

Description

Autoplot strucchange::breakpoints

Usage

1
2
3
4
5
6
7
8
## S3 method for class 'breakpoints'
autoplot(
  object,
  data = NULL,
  cpt.colour = "#FF0000",
  cpt.linetype = "dashed",
  ...
)

Arguments

object

strucchange::breakpoints or strucchange::breakpointsfull instance.

data

Original time series. Mandatory for plotting strucchange::breakpoints instance.

cpt.colour

Line colour for changepoints

cpt.linetype

Line type for changepoints

...

other arguments passed to autoplot.ts

Value

ggplot

Examples

1
2
3
4
5
library(strucchange)
bp.nile <- breakpoints(Nile ~ 1)
autoplot(bp.nile)
autoplot(bp.nile, is.date = TRUE)
autoplot(breakpoints(bp.nile, breaks = 2), data = Nile)

Example output

Loading required package: ggplot2
Loading required package: zoo

Attaching package: 'zoo'

The following objects are masked from 'package:base':

    as.Date, as.Date.numeric

Loading required package: sandwich

ggfortify documentation built on July 8, 2021, 1:07 a.m.