I have a vector
x <- c(-1, 0, 1, 2, 3)
I want all values less than 1 to be replaced by 1.
How?
Is there a no-loop so
pmax is a good candidate for this
pmax
> pmax(x, 1) [1] 1 1 1 2 3