rollingmerge: Rolling join two tables

View source: R/rollingmerge.R

rollingmergeR Documentation

Rolling join two tables

Description

Join tables using a rolling match on the last key column.

Usage

rollingmerge(
  x,
  y,
  by,
  direction = c("backward", "forward", "nearest"),
  tolerance = Inf
)

Arguments

x, y

Data frames or data tables to join.

by

Character vector of join columns. The last column is treated as the rolling key.

direction

Rolling direction: backward, forward, or nearest. With "nearest", a tie between an earlier and a later match of equal distance goes to the one that comes first in y.

tolerance

Maximum distance allowed for rolling matches.

Value

A basetable with rows from x joined to nearest matches in y.


basetable documentation built on Nov. 14, 2026, 1:08 a.m.