plot-methods: Visualisation of data and changepoint locations.

Description Usage Arguments Value Examples

Description

Plot methods for S4 objects returned by mrc. The plot produced depends on the type of the S4 object.

For objects produced by mrc a heatmap of the data is displayed along with the location of the univariate changepoints (yellow), most recent univariate changepoints (green), and most recent multivariate changepoint locations (red).

A number of arguments with default values are provided to control aspects of how the data and changepoint locations are displayed. The plot methods return a ggplot2 object which can be modified if required.

Usage

1
2
## S4 method for signature 'changepoint.mv.mrc.class,ANY'
plot(x, p = MDL(x), group = FALSE, display.variable.names = TRUE, show = TRUE)

Arguments

x

An S4 class returned by mrc.

p

Integer value indicating the number of most recent changepoint locations to consider. The minimum value is 1 and the maximum value is the value of pmax used in the call to mrc. Default value is the p=MDL(x) (see MDL for further details).

group

Logical value used to indicate if the variates that share a most recent changepoint should be grouped together in the plot. Default is group=FALSE.

display.variable.names

Logical value. If display.variable.names=TRUE then the variable names are displayed in the plot. If there are a large number of variates in the data, then it can be useful disable variable names by setting display.variable.names=FALSE. Default is display.variable.names=TRUE.

show

Logical value used to indicate if the plot should be displayed (the ggplot object produced by plot is always invisibly returned). Default value is show=TRUE.

Value

Invisibly returns a ggplot object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
# visualising most recent changepoints 
data(mrcexample)
res<-mrc(mrcexample[,1:10])
p.1<-plot(res,p=2)
p.2<-plot(res,p=5)
p.3<-plot(res,p=2,group=TRUE)
p.4<-plot(res,p=5,group=TRUE)
if(require(gridExtra))
{
  grid.arrange(p.1,p.2,p.3,p.4)
}

## End(Not run)

Example output

Loading required package: gridExtra

changepoint.mv documentation built on Aug. 7, 2020, 5:06 p.m.