ggts_w_rol_mean: Generate ggplot (Time-)Series Line Object with Rolling mean...

Description Usage Arguments Details Value See Also Examples

View source: R/ggts_climate.R

Description

Calculates rolling mean with stats::filter(y, filter = rep(1/span, span) and adding smooth line with geom_smooth(method = "loess").

Usage

1
ggts_w_rol_mean(data, time = Year_Month, y = count, span)

Arguments

data

data.frame with x (e.g. time line) and y data to be displayed, e.g. ggplot_w_rol_mean(weather_long, Year_Month, Temperature, span = span). time : numeric string (also of data and Time classes) as index for column name. y : numeric string as index for y column name.

time

data frame column for values of x axes.

y

data frame column for values of y axes.

span

integer width of the rolling window.

Details

The data input must be a valid data.frame.

data input format (e.g. Month in long format)
Year_Month ... count
<mth> ... <dbl>
1 1890 Jan ... 2.8
2 1890 Feb ... -1.7
:
n 2019 Dec ... 1.4

Value

plot object of mode 'plot

See Also

stats::filter and ggplot2::ggplot

Examples

1
ggts_w_rol_mean(ggplot2::economics, date, uempmed, span = 7)

WoVollmer/pkgTS documentation built on June 2, 2021, 4:02 a.m.