View source: R/which.closest.R
which.closest | R Documentation |
finds the closes match in a given vector of time
which.closest(Time, x)
Time |
vector of time in any format abs() accepts |
x |
object of time in any format abs() accepts |
Missing and NaN values are discarded.
an integer or on 64-bit platforms, if length(x) =: n>= 2^31 an integer valued double of length 1 or 0 (iff x has no non-NAs), giving the index of the first minimum or maximum respectively of x.
If this extremum is unique (or empty), the results are the same as (but more efficient than) which(x == min(x, na.rm = TRUE)) or which(x == max(x, na.rm = TRUE)) respectively.
Michael Thrun
abs
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.