tests/testthat/test-pull.R

test_that("pull", {
  expect_equal(
    mtcars %>% pull_dt(2),
    mtcars[,2]
  )

  expect_equal(
    mtcars %>% pull_dt(cyl),
    mtcars[["cyl"]]
  )

  expect_equal(
    mtcars %>% pull_dt(cyl),
    mtcars %>% pull_dt("cyl")
  )
})

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.