| movAvLines | R Documentation | 
Add moving average lines with different window widths to a plot
movAvLines(
  x = 1:length(y),
  y,
  widths = c(3, 5, 7, 9, 11, 13),
  weights,
  col = "blue",
  alpha = 0.3,
  add = TRUE,
  las = 1,
  ...
)
| 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  | 
Berry Boessenkool, berry-b@gmx.de, May 2015
movAv, addAlpha
set.seed(42)
movAvLines(y=cumsum(rnorm(50)), add=FALSE, lwd=3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.