pma function

Function to do an n-point moving average

Function to do an n-point moving average

Performs a moving average smoothing on a data series. de Winter, N. J. (2017) doi:10.5194/gmd-2017-137

pma(x, i, n)

Arguments

  • x: A numeric data frame containing the data set to be smoothed, X-values should be in the first column
  • i: The index of the column that contains the Y-values
  • n: Integer N-value determining the window size of the moving average smoothing

Returns

A numeric data frame containing three columns: One with X-values, one with Y-values and one with smoothed Y-values

References

de Winter, N. J.: ShellTrace v1.0 ? A new approach for modelling growth and trace element uptake in marine bivalve shells: Model verification on pacific oyster shells (Crassostrea gigas), Geosci. Model Dev. Discuss., https://doi.org/10.5194/gmd-2017-137, in review, 2017.

Author(s)

Niels J. de Winter

Note

Please cite Geoscientific Model Development paper dealing with the ShellTrace model

Source

GitHub

Manuscript

Supplementary data

Author website

Examples

Nile<-as.data.frame(Nile) Nile<-cbind(rownames(Nile),Nile) Nile_5pma<-pma(Nile,2,5)