| trimmedMean {gsmoothr} | R Documentation |
A slow trimmed mean smoother (using R code) of data at discrete points (e.g. probe-level data).
trimmedMean(pos, score, probeWindow=600, meanTrim=.1, nProbes=10)
pos |
numeric vector of positions (x-values) |
score |
numeric vector of data (corresponding to |
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 |
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.
vector (of the same length as sp giving the trimmed mean smoothed values
Mark Robinson
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)