tests/testthat/test-dt.R

test_that("as_dt", {
  ir = as_dt(iris)
  expect_equal(ir,as.data.table(iris))
})

test_that("in_dt",{
  ir = as_dt(iris)
  expect_equal(
    iris %>% in_dt(order(-Sepal.Length),.SD[.N],by=Species),
    ir[order(-Sepal.Length),.SD[.N],by=Species]
  )
})

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.