Description Usage Arguments Value Note Author(s) See Also Examples
The function lbound
sets a minimum to the elements of a vector, ubound
a maximum and bound
both.
1 2 3 |
x |
double, vector to put in [m, M]. |
m |
double, the minimum. |
M |
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 M
.
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
http://pgm-solutions.com/packages
1 2 3 | K <- 1
x <- rpgm.rnorm(12, 0.5)
lbound(x-K, 0)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.