Re: [R] replace NA with 9999 in zoo object

2008-03-06 Thread Gabor Grothendieck
It works just the same as matrices: > z <- zoo(cbind(a = c(1, NA, 3), b = c(NA, 10, 11))) > z[is.na(z)] <- 999 > z a b 1 1 999 2 999 10 3 3 11 > There are also a number of other methods for handling NAs in zoo: na.approx na.contiguous na.locf na.spline na.trim and na.stinterp in the

[R] replace NA with 9999 in zoo object

2008-03-06 Thread stephen sefick
This is the same set of data that I have been working with for those in the know. it is a matrix of ~174 columns and ~70,000 rows. I have it as a zoo object, but I could read it in as just a matrix as long as the date time stamp won't be corrupted. here is an example of what a column would look