question about joining time-series tables in R...
I have the following two dataframes; "arrivals" and "temps" (see below). "arrivals" describes the date/time/size of an arriving packet, and "temps" has minute-by-minute temperature data. What I would like to do is add a column in "arrivals", arrivals$tempAtArrivalTime, which lists the current temperature for a given arrival time. For instance, for the first arrival, at 8:39:04, I want the corresponding "tempAtArrivalTime" to be 76 (the most recently recorded temperature, at 8:39:00). Whats the easiest way to do this? Thanks!
>arrivals
date time size of arrival
2012 2013-09-09 08:39:04 15
2013 2013-09-09 08:43:15 3
2014 2013-09-09 08:47:50 7
2015 2013-09-09 08:54:47 10
> temps
date time temperature
2013-09-09 08:33:00 76
2013-09-09 08:34:00 75
2013-09-09 08:35:00 74
2013-09-09 08:36:00 75
2013-09-09 08:37:00 76
2013-09-09 08:38:00 76
2013-09-09 08:39:00 76
2013-09-09 08:40:00 76
2013-09-09 08:41:00 77
2013-09-09 08:42:00 78
2013-09-09 08:43:00 77
2013-09-09 08:44:00 78
2013-09-09 08:45:00 77
2013-09-09 08:46:00 77
2013-09-09 08:47:00 77
2013-09-09 08:48:00 77
2013-09-09 08:49:00 78
2013-09-09 08:50:00 79
2013-09-09 08:51:00 80
2013-09-09 08:52:00 80
2013-09-09 08:53:00 79
2013-09-09 08:54:00 78