Skip to content
Prev 243582 / 398513 Next

missing values

Hi,

(a) sum() and mean() have a na.rm argument that should be set to TRUE.

(b) let's try with an example:
x <- c(1:5, NA, NA, 6:10, NA)
x[is.na(x)] <- 0  ## replace NAs by 0

HTH,
Ivan


Le 12/1/2010 10:00, Iasonas Lamprianou a ?crit :