Learn R Programming

latticeExtra (version 0.6-11)

xyplot.stl: Display stl fits with Lattice

Description

Display stl decomposition (seasonal, trend and irregular components using loess) with Lattice, like the base graphics function plot.stl.

Usage

## S3 method for class 'stl':
xyplot(x, data = NULL,
       outer = TRUE,
       layout = c(1, 4),
       strip = FALSE,
       strip.left = TRUE,
       as.table = TRUE,
       ylab = "",
       between = list(y = 0.5),
       panel =
       function(..., type) {
           if (packet.number() == 4) type <- "h"
           panel.xyplot(..., type = type)
       },
       ...)

Arguments

x
an stl object.
data
ignored.
outer, layout, strip, strip.left
passed to xyplot.ts.
as.table, ylab, between, panel, ...
passed to xyplot.ts.

Value

  • An object of class "trellis". The update method can be used to update components of the object and the print method (usually called by default) will plot it on an appropriate plotting device.

Details

Unless strip.left is passed in explicitly, a custom strip will be drawn, where shaded bars are comparable across panels (representing the same data range).

See Also

stl, xyplot.ts, xyplot

Examples

Run this code
## example from ?stl
xyplot(stl(log(co2), s.window=21),
       main = "STL decomposition of CO2 data")

Run the code above in your browser using DataLab