Displaying 2 results from an estimated 2 matches for "myzoo".
Did you mean:
myfoo
2009 Dec 07
2
Filtering a zoo object based on index of another object
...intervals, I need to filter my
predicted dataset based on the measurement date of my observed data.
Here, is an example similar to what I have
library(chron);library(zoo)
DATE<- seq(as.Date("2009-01-01"), as.Date("2009-05-01"), by = 1)
mydat<- rnorm(length(DATE), 20,5)
myzoo<- zoo(mydat, order.by = DATE)
DATE2<- seq(as.Date("2009-01-01"), as.Date("2009-01-30"), by = 7)
Now I need to create a new zoo object with index as DATE2 and corresponding
data values.
Any kind of help will be highly appreciated.
Thanks in advance you very much
--
Ach...
2010 Aug 11
0
sweep and zoo objects
...8
246 9 19 29 39 49 59 69 79 89 99 109 119
284 10 20 30 40 50 60 70 80 90 100 110 120
#The desired result would be a merged zoo object with the row names used as
the colnames of the multiple zoo series
test2<-matrix(test,nrow=12, byrow=F)
g<-zoo(test2[,1],frequency=12)
MYZOO <-merge(g,test2[,2:10])
# the result MYZOO is a zoo object, but we've lost the row names in the
transformation of the matrix
#So
colnames(MYZOO)<-row.names(test)
#Fixes that problem. Is there a more elegant way to do this???
# now this zoo object needs to be "swept" out of a...