movAvLines {berryFunctions} | R Documentation |
Moving average with different window widths
Description
Add moving average lines with different window widths to a plot
Usage
movAvLines(
x = 1:length(y),
y,
widths = c(3, 5, 7, 9, 11, 13),
weights,
col = "blue",
alpha = 0.3,
add = TRUE,
las = 1,
...
)
Arguments
x |
x values of data. DEFAULT: 1:length(y) |
y |
y values that are smoothed with several window widths |
widths |
widths of |
weights |
weights within each window |
col |
color passed to |
alpha |
transparency passed to |
add |
Logical: Add to existing plot?Set to FALSE to first create the scatterplot. DEFAULT: TRUE |
las |
LabelAxisStyle (only relevant if add=FALSE). DEFAULT: 1 |
... |
further arguments passed to |
Author(s)
Berry Boessenkool, berry-b@gmx.de, May 2015
See Also
Examples
set.seed(42)
movAvLines(y=cumsum(rnorm(50)), add=FALSE, lwd=3)
[Package berryFunctions version 1.22.5 Index]