title: Merge two dataframes if timestamp of x is within time interval of y
body: <p>I cannot get a solution to this problem. I have two dataframes. DF1  and DF2. I would like to merge the columns of DF2 to DF1 if the timestamp in DF1 is within the time interval specified in DF2.
  Here is an example of the two dataframes:</p>
  
  <pre><code>DF1 &lt;- structure(list(Airspeed = c(582L, 478L, 524L), Outbound.Track = c(119L, 78L,134L), Rem.Ground.Dist = c(369L, 119L, 196L), Timestamp=structure(c(1451636817.52577, 1451638203.76569, 1451637753.43511),class = c("POSIXct", "POSIXt"), tzone = "")), .Names =c("Airspeed", "Outbound.Track","Rem.Ground.Dist", "Timestamp"), row.names =c(1L, 12L, 7L), class = c("data.table", "data.frame"))
  
  DF2 &lt;- structure(list(Temperature = c(-18.5, -60, -35), Wind_Direction = c("324", "335", "313"), Wind_Speed = c("032", "041", "056"), onebef =structure(c(1451629620, 1451634660, 1451637000), class = c("POSIXct", "POSIXt"), tzone = ""), oneaft = structure(c(1451636820, 1451641860, 1451644200), class =c("POSIXct", "POSIXt"))), .Names = c("Temperature", "Wind_Direction", "Wind_Speed","onebef", "oneaft"), row.names = c(1358L, 1654L, 2068L), class = "data.frame")
  
  head(DF1)
  head(DF2)
  </code></pre>
  
  <p>I want to merge DF1 with DF2. So if there is a match (timestamp of DF1 is within time interval of any DF2), the values of DF2 (Wind_Speed, Wind_Direction, Temperature) should be added to DF1.</p>
  
  <p>Two Problems I am facing:</p>
  
  <ol>
  <li><p>How to do the match/merge? My dataframe is quite large (7000 rows in DF1 and DF2)</p></li>
  <li><p>How to ensure that rows of DF1 are duplicated if there are several matches?</p></li>
  </ol>
  
  <p>I am looking forward to your help!Thanks</p>