tests/testthat/test-nearestmerge.R

test_that("nearestmerge wraps rollingmerge nearest mode", {
  x <- data.frame(id = c(1, 3), value = c("a", "b"))
  y <- data.frame(id = c(2, 4), label = c("c", "d"))

  out <- nearestmerge(x, y, by = "id")

  expect_s3_class(out, "basetable")
  expect_true("id" %in% names(out))
})

Try the basetable package in your browser

Any scripts or data that you put into this service are public.

basetable documentation built on Sept. 18, 2026, 9:13 a.m.