mvtsplot: A function for plotting multivariate time series data

View source: R/mvtsplot.R

mvtsplotR Documentation

A function for plotting multivariate time series data

Description

A function for plotting multivariate time series data

Usage

mvtsplot(
  x,
  group = NULL,
  xtime = NULL,
  norm = c("internal", "global"),
  levels = 3,
  smooth.df = NULL,
  margin = TRUE,
  sort = NULL,
  main = "",
  palette = "PRGn",
  rowstat = "median",
  xlim,
  bottom.ylim = NULL,
  right.xlim = NULL,
  gcol = 1
)

Arguments

x

a matrix of N rows and P columns, where P is the number of time series and N is the number of observations per series

group

a length N vector indicating group membership of each row of the matrix (optional)

xtime

a length N vector containing the time index (optional)

norm

normalization technique (see Details)

levels

number of levels for mapping categories into colors

smooth.df

the number of degrees of freedom to be used for the spline smoother

margin

should the margin plots be shown (default = TRUE)

sort

a function computing a numerical statistic that can be used for ordering the rows (default is no sorting)

main

title for the plot

palette

name of the Color Brewer palette to be used

rowstat

a function computing a numerical statistic on the rows for displaying on the margin (default is median)

xlim

limits for the x-axis

bottom.ylim

y-axis limits for the bottom margin

right.xlim

x-axis limits for the right margin

gcol

color for lines separating groups

Details

For the normalization, specifying "internal" means that each time series is categorized into colors based on the range of values in each time series individually. Therefore, under this scenario, the same color in two different time series will have two different meanings. If "global" is specified, then each time series will be categorized based on the range of values for the entire collection of time series. In this case, the colors are comparable across series.

Author(s)

Roger D. Peng rpeng@jhsph.edu

References

Peng RD (2008). "A method for visualizing multivariate time series data," Journal of Statistical Software, 25 (Code Snippet), 1–17.

Examples

x <- matrix(rnorm(2000), 100, 20)
mvtsplot(x)


rdpeng/mvtsplot documentation built on May 18, 2022, 5:52 a.m.