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 Oct. 12, 2024, 1:06 a.m.