tests/testthat/test_reunite.R

data <- data.frame(fir = c(NA, "two", "three", NA),
                   sec = c("one", NA, "three", NA), stringsAsFactors = F)
dat2 <-  data.frame(single = c("one", "two", "three", NA), stringsAsFactors = F)

test_that("missing values dropped", {
  expect_equal(transmutate(data, single = reunite(fir, sec)),
               dat2)
})
globalgov/qData documentation built on Nov. 17, 2022, 2:42 p.m.