nearest_time | R Documentation |
Finds nearest time stamp in time 2 for each row of time 1. Optionally can include difference.
nearest_time( time1, time2, unit = "secs", output_dif = FALSE, break_ties = "earlier" )
time1 |
vector of timestamps (class of "POSIXct" "POSIXt") |
time2 |
vector of timestamps to campare time 1 to (class of "POSIXct" "POSIXt") |
unit |
time unit ("secs", "mins", "hours", "days", or "weeks"): defualt is "secs" |
output_dif |
Logical specifying whether or not the time difference for each row should be output (default is FALSE |
break_ties |
if to times from time2 are equidistant should the "earlier" or "later" time be chosen (default is "earlier") |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.