plot {cpop}R Documentation

Visualise changepoint locations and associated data

Description

Plot methods for S4 objects returned by cpop.

Usage

## S4 method for signature 'cpop.class,ANY'
plot(x)

Arguments

x

An instance of an cpop S4 class produced by cpop.

Value

A ggplot object.

Examples

library(cpop)

# simulate data with change in gradient
set.seed(1)
x <- (1:50/5)^2
y <- simchangeslope(x,changepoints=c(10,50),change.slope=c(0.25,-0.25),sd=1)

# analyse data
res <- cpop(y,x,beta=2*log(length(y)))

# generate plot object
p <- plot(res)

# visualise
print(p)


[Package cpop version 1.0.6 Index]