R: Trimmed Mean Smoother

trimmedMean {gsmoothr} | R Documentation

## Trimmed Mean Smoother

### Description

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

### Usage

    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

    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)

[Package gsmoothr version 0.1.7 Index]