tests/testthat/test-fbind.r

test_that("fbind() binds factor (or character)", {
  x <- c("a", "b")
  x_fact <- factor(x)
  y <- c("c", "d")
  z <- factor(c("a", "b", "c", "d"))

  expect_identical(fbind(x, y), z)
  expect_identical(fbind(x_fact, y), z)
})
Wandergarten/R-welcomes-C-package-primer documentation built on Feb. 9, 2021, 9:15 p.m.