Learn R Programming

codyna (version 0.1.0)

plot.regimes: Plot Time Series Data with Detected Regime Stability

Description

Plot Time Series Data with Detected Regime Stability

Usage

# S3 method for regimes
plot(x, points = FALSE, ...)

Value

A ggplot object.

Arguments

x

[regimes]
Output of detect_regimes().

points

[logical(1)]
Should a point be added for each observation? The points are colored by regime stability (default: FALSE).

...

Ignored.

Examples

Run this code
set.seed(123)
ts_data <- stats::arima.sim(list(order = c(1, 1, 0), ar = 0.6), n = 200)
regimes <- detect_regimes(
  data = ts_data,
  method = "threshold",
  sensitivity = "medium"
)
plot(regimes)

Run the code above in your browser using DataLab