tsdisplay {forecast}R Documentation

Time series display

Description

Plots a time series along with its acf and either its pacf, lagged scatterplot or spectrum.

ggtsdisplay will produce the equivelant plot using ggplot graphics.

Usage

tsdisplay(x, plot.type=c("partial","scatter","spectrum"),
    points=TRUE, ci.type=c("white", "ma"), 
    lag.max, na.action=na.contiguous, 
    main=NULL, xlab="", ylab="", pch=1, cex=0.5, ...)
    
ggtsdisplay(x, plot.type=c("partial","scatter","spectrum"),
    points=TRUE, lag.max, na.action=na.contiguous, theme=NULL, ...)

Arguments

x

a numeric vector or time series.

plot.type

type of plot to include in lower right corner.

points

logical flag indicating whether to show the individual points or not in the time plot.

ci.type

type of confidence limits for ACF that is passed to acf. Should the confidence limits assume a white noise input or for lag k an MA(k-1) input?

lag.max

the maximum lag to plot for the acf and pacf. A suitable value is selected by default if the argument is missing.

na.action

function to handle missing values in acf, pacf and spectrum calculations. The default is na.contiguous. Useful alternatives are na.pass and na.interp.

theme

Adds a ggplot element to each plot, typically a theme.

main

Main title.

xlab

X-axis label.

ylab

Y-axis label.

pch

Plotting character.

cex

Character size.

...

additional arguments to acf.

Value

None.

Author(s)

Rob J Hyndman

References

Hyndman and Athanasopoulos (2014) Forecasting: principles and practice, OTexts: Melbourne, Australia. http://www.otexts.org/fpp/

See Also

plot.ts, Acf, spec.ar

Examples

tsdisplay(diff(WWWusage))
ggtsdisplay(USAccDeaths, plot.type="scatter")

library(ggplot2)
ggtsdisplay(USAccDeaths, plot.type="scatter", theme=theme_bw())

[Package forecast version 7.3 Index]