tests/testthat/test_utils.R

d <- data.frame(x = c(1, 2, 3, 4), y = c(10, 20, 30, 40))
tst <- function(x) {
   col <- rlang::enquo(x)
   x_col <- rlang::enquo(x)
   d <- col_to_factor(d, x_col)
   d
}
w <- tst(x)
test_that("The first column has been converted to factor",{
  expect_is(w$x, "factor")
})

Try the ezEDA package in your browser

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

ezEDA documentation built on June 29, 2021, 9:05 a.m.