tests/testthat/test-updatemerge.R

test_that("updatemerge updates selected columns", {
  x <- data.frame(id = c(1, 2, 3), value = c("a", "b", "c"), other = c(1, 2, 3))
  y <- data.frame(id = c(2, 3), value = c("z", "y"))

  out <- updatemerge(x, y, by = "id", cols = "value")

  expect_s3_class(out, "basetable")
  expect_equal(out$value, c("a", "z", "y"))
  expect_equal(out$other, c(1, 2, 3))
})

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.