trim | R Documentation |
Given an array, matrix, or vector, trim
will truncate all
elements smaller than epsilon
(in absolute value) to zero.
trim(X, epsilon = 10^-6)
X |
An array, a matrix, or a vector. |
epsilon |
A numeric. |
All elements in X
that are smaller than epsilon
(in
absolute value) will be set to zero then returned.
David Gerard.
X <- c(0, 1, 10^-7, -1, -10^-7) X trim(X)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.