[R] recode vector values to NA
Bill Simpson
wsi at gcal.ac.uk
Tue Mar 27 10:13:00 CEST 2001
> x <- rnorm(10000)
>
> and I want to recode all values of x > 1.5 to NA. How would I do that in R?
x<-ifelse(x>1.5,NA,x)
Bill
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list