medsmoo: Median Smoother

Description Usage Arguments Value References See Also Examples

View source: R/medsmoo.R

Description

Mean and median smoothing of numerical vectors with optional edge preservation.

Usage

1
medsmoo(x, m, m2, edge = c("both"))

Arguments

x

numeric vector

m

half width of the smoother

m2

half width of the smoother at the edges

edge

"left", "right" or "both" for application of smaller windows towards the edges

Value

A list of

rmedian

running median

rmean

running mean

rmad

running median absolute deviation

smootherwidth

smoother width for each point

edge

which edges have been treated

References

Mann, M. E., & Lees, J. M. (1996). Robust estimation of background noise and signal detection in climatic time series. Climatic change, 33(3), 409-445.

See Also

codegausssmooth

Examples

1
2
3
4
5
6
X<-rnorm(50,mean=0,sd=1)+seq(0,10,length.out=50)
plot(X,type="l")
lines(seq(0,10,length.out=50))
lines(medsmoo(X,10,5)$rmean,col="red")
points(medsmoo(X,10,5,"right")$rmean,col="orange")
points(medsmoo(X,10,5,"left")$rmean,col="blue2")

krehfeld/nest documentation built on May 28, 2019, 12:33 a.m.