[R] temporal join

mckenzig mckenzig at optonline.net
Sun Jan 11 03:32:37 CET 2009


I have dataframe a:

sym date val1
=== ==== ====
foo 20090101 a1
foo 20090102 a2
foo 20090103 a3

and dataframe b:

sym date val2
=== ==== ====
foo 20090104 b1

I would like to join/merge them to generate the following:

sym date val2 val1
=== ==== ==== ====
foo 20090104 b1 a3

i.e. an equijoin on column 'sym' and a temporal join on column 'date'
where the closest matching row is retrieved. I have been through the
various regular/irregular timeseries packages and can not see anything
like this.

Regards.




More information about the R-help mailing list