Learn R Programming

gmwm (version 2.0.0)

autoplot.lts: Plot the Latent Time Series Graph

Description

Plots the graph of latent time series using ggplot2

Usage

"autoplot"(object, to.unit = NULL, background = "white", scales = "free", line.type = NULL, line.color = NULL, point.size = NULL, point.shape = NULL, title = NULL, title.size = 15, axis.label.size = 13, axis.tick.size = 11, axis.x.label = NULL, axis.y.label = NULL, facet.label.size = 13, facet.label.background = "#003C7D33", ncol = 1, nrow = NULL, ...)

Arguments

object
A lts object
to.unit
A string indicating the unit which the data is converted to. The supported units are "ns"(nanosecond), "ms"(millisecond), "sec", "min", "hour", "day", "month", and "year".
background
A string that determines the graph background. It can be "grey" or "white".
scales
Same as scales in facet_wrap() in ggplot2 package: should scales be fixed ("fixed"), free ("free"), or free in one dimension ("free_x", "free_y"). The default is "free" in this function.
line.type
A vector of string that indicates the type of lines.
line.color
A vector of string that indicates the color of lines.
point.size
A vector of integer that indicates the size of points on lines.
point.shape
A vector of integer that indicates the shape of points on lines.
title
A string that indicates the title of the graph.
title.size
An integer that indicates the size of title.
axis.label.size
An integer that indicates the size of label.
axis.tick.size
An integer that indicates the size of tick mark.
axis.x.label
A string that indicates the label on x axis.
axis.y.label
A string that indicates the label on y axis.
facet.label.size
An integer that indicates the size of facet label.
facet.label.background
A string that indicates the background color of the facet label.
ncol
An integer that indicates number of columns.
nrow
An integer that indicates number of rows.
...
other arguments passed to specific methods.

Value

A ggplot2 panel containing the graph of latent time series.

Examples

Run this code
model = AR1(phi = .99, sigma = 1) + WN(sigma2=1)
res = gen.lts(model, N = 100)
autoplot(res)

# Modify the graph aesthetics
autoplot(res, line.color = c('blue', 'green', 'black'), point.size = c(1,1,1))

Run the code above in your browser using DataLab