[R] missing value

From: Mauricio Cardeal <mcardeal_at_ufba.br>
Date: Wed 02 Aug 2006 - 22:55:41 EST


Hi all

# I have this data set and how can I assign NAs in just one command ? And why the summary(dat) function preserves the value 9 as real. ?

x <- c(1,2,3,9,4)
y <- c(3,6,9,2,3)
z <- c(9,9,2,2,8)
w <- c(6,5,3,0,9)

dat <- cbind(x,y,z,w)
summary(dat)

x[x==9] <- NA
y[y==9] <- NA
z[z==9] <- NA
w[w==9] <- NA

summary(dat)
summary(x)
summary(y)

summary(z)
summary(w)

Thank you all,
Mauricio



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri Aug 04 08:41:24 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 04 Aug 2006 - 10:20:57 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.