tests/testthat/test-has_sparse_elements.R

test_that("has_sparse_elements() works", {
  expect_false(has_sparse_elements(mtcars))

  mtcars$sparse <- sparse_integer(1, 1, 32)

  expect_true(has_sparse_elements(mtcars))
})

Try the sparsevctrs package in your browser

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

sparsevctrs documentation built on June 8, 2025, 1:48 p.m.