plot.trend: Plot trend of time series

Description Usage Arguments Value Author(s)

View source: R/plot.R

Description

Take time series data and overlay their trend over raw trace.

Usage

1
2
3
4
5
6
7
plot.trend(
  data,
  method = c("loess", "ma", "lm", "gam", "glm"),
  ...,
  date = NULL,
  name = NULL
)

Arguments

data

Time series data or list of them whose trend is to be plotted. The data should be either ts object or numeric vector.

method

Smoothing method. Should be one of "loess", "ma", "lm", "gam", and "glm". (default = "loess")

...

Extra arguments for smoothing. Refer to ma and geom_smooth. In caes of MA, if order argument is not given, 10 will be as default value.

date

POSIXct vector or list of them for x axis. If NULL, it uses integer index 1, 2, ... instead. (default = NULL)

name

Character vector of data names for facet titles. If NULL, it uses the name of input data argument instead. (default = NULL)

Value

ggplot object of the plot

Author(s)

Sanghyun Park, Daun Jeong, and Sehun Kim


eik4862/Subway documentation built on Sept. 24, 2021, 3:39 a.m.