tests/testthat/test_set.col.type.R

###
test_that("Insert one column in data.frame by name", {
  out <- set.col.type(mtcars, col.type = list("character" = c("cyl")))
  expect_true(is.character(out$cyl))
  expect_equal(out$cyl, as.character(mtcars$cyl))
})

Try the eatTools package in your browser

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

eatTools documentation built on Nov. 23, 2023, 5:06 p.m.