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 July 26, 2023, 5:20 p.m.