Description Usage Arguments Details Value Author(s) See Also Examples
A fast trimmed mean smoother (using C code) of data at discrete points (e.g. probe-level data).
1 |
sp |
numeric vector of positions (x-values) |
x |
numeric vector of data (corresponding to |
spout |
optional vector of output values to calculate trimmed mean at, default: NULL |
nProbes |
minimum number of observations required within window |
probeWindow |
distance (in x) in each direction to look for observations to be used in the trimmed mean |
trim |
proportion of trim to use in trimmed mean |
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
(or spout
)) giving the trimmed mean smoothed values
Mark Robinson
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | sp <- seq(100, 1000, by=100)
ss <- seq(100,1000, by=50)
set.seed(14)
x <- rnorm(length(sp))
tmC <- tmeanC(sp, x, probeWindow=300, nProbes=5)
tmC1 <- tmeanC(sp, x, spout=sp, probeWindow=300, nProbes=5)
tmC2 <- tmeanC(sp, x, spout=ss, probeWindow=300, nProbes=5)
cbind(tmC,tmC1)
plot(sp, x, type="h", ylim=c(-2,2))
lines(sp, tmC1, col="blue")
lines(ss, tmC2, col="red")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.