tests/testthat/test-new-data-frame.R

test_that("new_data_frame returns a data.frame of expected dimensions", {
  df <- new_data_frame(list(x = 1:3, y = c("a", "b", "c")))

  expect_s3_class(df, "data.frame")
  expect_equal(nrow(df), 3)
  expect_equal(ncol(df), 2)
  expect_named(df, c("x", "y"))
})

Try the gtable package in your browser

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

gtable documentation built on Oct. 30, 2024, 9:29 a.m.