trimmedMean: Trimmed Mean Smoother

Description Usage Arguments Details Value Author(s) See Also Examples

Description

A slow trimmed mean smoother (using R code) of data at discrete points (e.g. probe-level data).

Usage

1
trimmedMean(pos, score, probeWindow=600, meanTrim=.1, nProbes=10) 

Arguments

pos

numeric vector of positions (x-values)

score

numeric vector of data (corresponding to sp

probeWindow

distance (in x) in each direction to look for observations to be used in the trimmed mean

meanTrim

proportion of trim to use in trimmed mean

nProbes

minimum number of observations required within window

Details

Using the specified probe window, this procedure uses all values within the window and calculates a trimmed mean with the specified amount of trim. If there are not enough observations within the window at a given position (as given by nProbes), a zero is returned.

Value

vector (of the same length as sp giving the trimmed mean smoothed values

Author(s)

Mark Robinson

See Also

tmeanC

Examples

1
2
3
4
5
6
sp <- seq(100, 1000, by=100)
ss <- seq(100,1000, by=50)
set.seed(14)
x <- rnorm(length(sp))

tmC <- trimmedMean(sp, x, probeWindow=300, nProbes=5)

gsmoothr documentation built on May 2, 2019, 5:53 p.m.