tests/testthat/test-sample_dt.R

test_that("sample", {

  expect_is(
    sample_n_dt(mtcars, 1),
    "data.table"
  )

  expect_is(
    sample_n_dt(mtcars, 1),
    "data.frame"
  )

  expect_is(
    sample_frac_dt(mtcars, .1),
    "data.table"
  )

  expect_is(
    sample_frac_dt(mtcars, .1),
    "data.frame"
  )

})

Try the tidyfst package in your browser

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

tidyfst documentation built on Sept. 16, 2024, 9:06 a.m.