lbound sets a minimum to the elements of a vector,
ubound a maximum and
1 2 3
double, vector to put in [m, M].
double, the minimum.
double, the maximum.
A vector with the values of
x on which all values lower that
m has been replaced by
m and all values greater than
M has been replace by
x <- lbound(x, a) replaces
x <- x*(x >= a) + a*(x < a) and
x[x < a] <- a in a much faster way.
Nicolas Baradel - PGM Solutions
1 2 3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.