tests/testthat/test_fbind.R

context("Binding Factors")

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)
})
etesdahl/fooFactors documentation built on May 26, 2019, 9:36 a.m.