Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

runMean

Calculate a running mean from a numeric vector.


Description

Calculate a running mean from a numeric vector.

Usage

runMean(x, n, edge = "NA")

Arguments

x

numeric vector to smooth.

n

the size of the window in which to smooth.

edge

How to treat edge cases where a full window is unavailable. Current options are 'NA' to fill with NAs or 'fill' to fill with original values

Value

A numeric vector of smoothed values.

Examples

x <- rnorm(1000)
y <- c(1:1000)
plot(y,x, type="l")
lines(runMean(x,50), col="red")

rcarbon

Calibration and Analysis of Radiocarbon Dates

v1.4.2
GPL (>= 2)
Authors
Andrew Bevan [aut] (<https://orcid.org/0000-0001-7967-3117>), Enrico Crema [aut, cre] (<https://orcid.org/0000-0001-6727-5138>), R. Kyle Bocinsky [ctb], Martin Hinz [ctb], Philip Riris [ctb], Fabio Silva [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.