| nonequimerge | R Documentation |
Unlike a plain equi-merge, nonequimerge() supports
inequality conditions between columns of x and y (for example,
matching each x row to every y row whose date range contains
x's date), in addition to any exact-match columns in by.
nonequimerge(x, y, by, ...)
x, y |
Data frames or data tables to join. |
by |
Character vector of join conditions. A plain column name (present
in both |
... |
Currently ignored; reserved for future join
(e.g. |
A basetable with one row per matching x/y pair (an inner
join: rows of x with no matching y row are dropped).
x <- data.frame(id = 1, date = as.Date("2024-01-15"))
y <- data.frame(
id = 1,
start_date = as.Date(c("2024-01-01", "2024-02-01")),
end_date = as.Date(c("2024-01-31", "2024-02-28")),
period = c("Jan", "Feb")
)
nonequimerge(x, y, by = c("id", "date>=start_date", "date<=end_date"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.