Find a vector excluding trimmed values, on which the calculation of a statistic will result in a trimmed statistic.
Usage
trim(x, trim = 0, na.rm = FALSE, ...)
Arguments
x
A numeric vector of real values.
trim
The fraction (0 to 0.5) of observations to be trimmed from each end of x.
na.rm
A logical value indicating whether NA values should be stripped.
...
Further arguments passed to or from other methods.
Value
If trim is zero (the default), the values in x is returned. If x is not logical (coerced to numeric), numeric (including integer) or complex, NA_real_ is returned, with a warning. If trim is non-zero, a symmetrically trimmed vector is returned with a fraction of trim observations deleted from each end.