Skip to content

temporal join

3 messages · Jonathan Greenberg, Gabor Grothendieck

#
zoo makes no assumptions regarding times and
dates other than they are ordered and have certain
methods. It doesn't even know the difference between
a time and a date nor does it know about any time
or date classes.  (The exception is interface routines
such as read.zoo.)

If the dates uniquely specify the date times do we really
need the times in the first place and if we have them
what times would the merged object have?  The easiest
solution seems to be just convert to dates only.  Thus
assuming the dates uniquely specify the points:
On Fri, Mar 13, 2009 at 10:12 PM, Jonathan Greenberg <jgrn307 at gmail.com> wrote:
At least for zoo that's not true. It has no idea of what the index class is.
All it knows is that its some ordered class that has certain methods.
(The exception is interface routines as they need to may external
representations.)
If its truly 1-1, i.e. they have the same number of comonents and
the i-th component of the first series corresponds to the i-th
component of the second seriesm, then just cbind their data and
use the times of the first series, say:

library(zoo)
library(chron)

# test data
x <- zoo(1:3, as.chron("2000-01-01 18:12:00") + 0:2)
y <- zoo(4:6, time(x) + 0.1)

zoo(cbind(coredata(x), coredata(y)), time(x))
#
Sorry there was some garbage at the beginning.  Should just
be:

On Sat, Mar 14, 2009 at 6:03 AM, Gabor Grothendieck
<ggrothendieck at gmail.com> wrote: