July 23, 2010

which(is.na(t.zoo[,2]))

which row has an NA value in the second column of variable t.zoo

Remove NA values

A<-na.omit(A)

ts1[ts1[,6]>0,]

selects all rows of matrix “ts1” that in column 6 have a value greater than zero. Don’t forget the very last comma!