title: Fuzzy Join with POSIXct and POSIXt
body: <pre><code>test1 &lt;- structure(list(trip_count = 1:10, pickup_datetime = structure(c(1357019059, 
  1357019939, 1357022493, 1357023065, 1357024439, 1357025235, 1357026348, 
  1357026924, 1357027562, 1357028863), tzone = &quot;UTC&quot;, class = c(&quot;POSIXct&quot;, 
  &quot;POSIXt&quot;)), dropoff_datetime = structure(c(1357019158, 1357021384, 
  1357023008, 1357024189, 1357024694, 1357025815, 1357026604, 1357027240, 
  1357027830, 1357029381), tzone = &quot;UTC&quot;, class = c(&quot;POSIXct&quot;, 
  &quot;POSIXt&quot;))), row.names = c(NA, -10L), class = c(&quot;tbl_df&quot;, &quot;tbl&quot;, 
  &quot;data.frame&quot;))
  test2 &lt;- structure(list(DATE = structure(c(1357001460, 1357005060, 1357008660, 
  1357012260, 1357015860, 1357019460, 1357023060, 1357026660, 1357030260, 
  1357033860), class = c(&quot;POSIXct&quot;, &quot;POSIXt&quot;), tzone = &quot;UTC&quot;), 
      HourlyDryBulbTemperature = c(39L, 38L, 39L, 39L, 39L, 39L, 
      39L, 38L, 39L, 39L), HourlyPrecipitation = c(0, 0, 0, 0, 
      0, 0, 0, 0, 0, 0)), row.names = c(NA, 10L), class = &quot;data.frame&quot;)
  </code></pre>
  <p>Hey guys, so I have two data frames and I want to join them based on the date and time. It should be a <code>fuzzy_join</code> so that the join works if <code>DATE</code> from <code>test2</code> is within <code>pickup_datetime</code> and <code>dropoff_datetime</code> from <code>test1</code>.
  I tried</p>
  <pre><code>test1 &lt;- fuzzy_left_join(test1,test2,by = c(&quot;DATE&quot; = &quot;pickup_datetime&quot;, &quot;DATE&quot; = &quot;dropoff_datetime&quot;),match_fun = list(`&gt;=`, `&lt;=`))
  </code></pre>
  <p>but this returns: <code>Error: All columns in a tibble must be vectors. Column &quot;col&quot; is NULL.</code></p>
  <p>UPDATE: I found a solution</p>
  <pre><code>dropoff_data &lt;- str_split_fixed(test1$dropoff_datetime, &quot; &quot;, 2)
  colnames(dropoff_data) &lt;- c(&quot;join_date&quot;,&quot;dropoff_time&quot;)
  test1 &lt;- cbind.data.frame(test1,dropoff_data)
  test1$join_time &lt;- hour(hms(as.character(test1$dropoff_time)))
  rm(dropoff_data)
  
  dropoff_data &lt;- str_split_fixed(test2$DATE, &quot; &quot;, 2)
  colnames(dropoff_data) &lt;- c(&quot;join_date&quot;,&quot;time&quot;)
  test2 &lt;- cbind.data.frame(test2,dropoff_data)
  test2$join_time &lt;- hour(hms(as.character(test2$time)))
  rm(dropoff_data)
  
  test1 &lt;- left_join(test1,test2,by = c(&quot;join_date&quot;,&quot;join_time&quot;))
  </code></pre>
  <p>Thanks everyone!</p>