On 11/14/05, Brandt, T. (Tobias) <[EMAIL PROTECTED]> wrote: > > > Hi > > I've been greatly enjoying the functionality the zoo package offers. > However I've hit a snag with the following code > > > a <- zoo(matrix(1:10,5,2), 2001:2005) > > a > > 2001 1 6 > 2002 2 7 > 2003 3 8 > 2004 4 9 > 2005 5 10 > > a[I(2003), 2] > > 2003 8 > > a[I(2003), 2] <- NA > Error: subscript out of bounds > > > > I've also tried > > > coredata(a[I(2003), 2]) <- NA > Error: subscript out of bounds > > > > but that doesn't work either. I can of course do
Try this: window(a, 2003)[,2] <- NA See ?"window<-.zoo" for more info. ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
