Description Usage Arguments Value
Takes two data frames each with time/date columns in date-time or date format (i.e., able to be compared using the function difftime), finds the rows of df2 that minimize the absolute value of the datetime for each of the rows in df1, and merges the corresponding rows of df2 into df1 for downstream processing.
1 | nearestTimeandID(df1, df2, timeCol1, timeCol2, IDcol)
|
df1 |
Data frame containing the dates for which the differences between the other data frame's date column should be minimized for each row. |
df2 |
Data frame containing the dates which should be compared to, as well as other values that should be merged to df1 per minimized date time. |
timeCol1 |
Character vector specifying the date/time column in df1. |
timeCol2 |
Character vector specifying the date/time column in df2. |
IDcol |
Must be unique by row in df1. Multiple versions are allowed (and expected at least in some rows, as that is the point of the function) in df2. |
A merged data frame that minimizes datetime differences.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.