Skip to content
Prev 173881 / 398503 Next

Best way to do temporal joins in R?

Sorry for the immediate follow-up, but Phil Spector correctly reminded 
me this is a lot easier for the community I provide some sample data, so 
I'm attaching 3 small CSVs to this email:

species_data_Rexample.csv contains the "field data" (which species was 
ID'd and what time it was ID'd),
temperature_data_Rexample.csv contains the date, time, station ID and 
the temperature "value"

I'd like a dataframe which contains for each unique line in 
species_data_Rexample.csv, a series of lines, one per station, and the 
temperature of the nearest time stamp, or an interpolated value 
(weighted average would be fine, but so would just grabbing the nearest 
value), so for this example I'd like something that looks like the csv 
"fused_data_Rexample.csv"

Thanks!

--j
Jonathan Greenberg wrote: