[R] looking for .. dec if vector if element > x

Knut Krueger rh at krueger-family.de
Tue May 18 16:19:20 CEST 2010


Henrique Dallazuanna schrieb:
> Try this also:
>
> pmax(test - 1, 1)
>
> O
test  <- c(1,3,5,7,9,11,12,13,14)
test
test <- pmax(test - 1, 1)
test

This works for 1
what about if  I would dec 11: to 14  to close the gap between 9 and 10 ?
I did not find the answer with the help file

Thank you Knut



More information about the R-help mailing list