Description Usage Arguments Value Examples
View source: R/closestDatetime.R
Function that finds the closest datetime_ within a vector of given datetimes. E.g. one has a point of a track at a given time and searches for the closest wind data.
1 | closestDatetime(datetime_, datetimes)
|
datetime_ |
Given time as POSIXct |
datetimes |
Vector of possible datetimes as POSIXct |
Closest datetime as POSIXct
1 2 3 4 5 6 | d1 = as.POSIXct("2014-06-09 21:44:25 CEST")
dt = as.POSIXct( c("2014-06-08 23:00:00 CEST", "2014-06-09 05:00:00 CEST",
"2014-06-09 11:00:00 CEST", "2014-06-09 17:00:00 CEST",
"2014-06-09 23:00:00 CEST", "2014-06-10 05:00:00 CEST",
"2014-06-10 11:00:00 CEST", "2014-06-10 17:00:00 CEST") )
closestDatetime(datetime_ = d1, datetimes = dt)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.