diff --git a/R/sparsevctrs.R b/R/sparsevctrs.R index fee4319af..447769a40 100644 --- a/R/sparsevctrs.R +++ b/R/sparsevctrs.R @@ -17,10 +17,6 @@ #' @name sparse_data NULL -is_sparse_tibble <- function(x) { - any(vapply(x, sparsevctrs::is_sparse_vector, logical(1))) -} - is_sparse_matrix <- function(x) { methods::is(x, "sparseMatrix") } diff --git a/tests/testthat/test-sparsevctrs.R b/tests/testthat/test-sparsevctrs.R index c09f66dda..320e858c1 100644 --- a/tests/testthat/test-sparsevctrs.R +++ b/tests/testthat/test-sparsevctrs.R @@ -9,7 +9,7 @@ test_that("recipe() accepts sparse tibbles", { ) expect_true( - is_sparse_tibble(rec_spec$template) + sparsevctrs::has_sparse_elements(rec_spec$template) ) expect_no_condition( @@ -17,7 +17,7 @@ test_that("recipe() accepts sparse tibbles", { ) expect_true( - is_sparse_tibble(rec_spec$template) + sparsevctrs::has_sparse_elements(rec_spec$template) ) expect_no_condition( @@ -25,7 +25,7 @@ test_that("recipe() accepts sparse tibbles", { ) expect_true( - is_sparse_tibble(rec_spec$template) + sparsevctrs::has_sparse_elements(rec_spec$template) ) }) @@ -42,7 +42,7 @@ test_that("prep() accepts sparse tibbles", { ) expect_true( - is_sparse_tibble(rec$template) + sparsevctrs::has_sparse_elements(rec$template) ) expect_no_error( @@ -50,7 +50,7 @@ test_that("prep() accepts sparse tibbles", { ) expect_true( - is_sparse_tibble(rec$template) + sparsevctrs::has_sparse_elements(rec$template) ) }) @@ -68,7 +68,7 @@ test_that("bake() accepts sparse tibbles", { ) expect_true( - is_sparse_tibble(res) + sparsevctrs::has_sparse_elements(res) ) expect_no_error( @@ -76,7 +76,7 @@ test_that("bake() accepts sparse tibbles", { ) expect_true( - is_sparse_tibble(res) + sparsevctrs::has_sparse_elements(res) ) }) @@ -91,7 +91,7 @@ test_that("recipe() accepts sparse matrices", { ) expect_true( - is_sparse_tibble(rec_spec$template) + sparsevctrs::has_sparse_elements(rec_spec$template) ) expect_no_condition( @@ -99,7 +99,7 @@ test_that("recipe() accepts sparse matrices", { ) expect_true( - is_sparse_tibble(rec_spec$template) + sparsevctrs::has_sparse_elements(rec_spec$template) ) expect_no_condition( @@ -107,7 +107,7 @@ test_that("recipe() accepts sparse matrices", { ) expect_true( - is_sparse_tibble(rec_spec$template) + sparsevctrs::has_sparse_elements(rec_spec$template) ) }) @@ -124,7 +124,7 @@ test_that("prep() accepts sparse matrices", { ) expect_true( - is_sparse_tibble(rec$template) + sparsevctrs::has_sparse_elements(rec$template) ) expect_no_error( @@ -132,7 +132,7 @@ test_that("prep() accepts sparse matrices", { ) expect_true( - is_sparse_tibble(rec$template) + sparsevctrs::has_sparse_elements(rec$template) ) }) @@ -150,7 +150,7 @@ test_that("bake() accepts sparse matrices", { ) expect_true( - is_sparse_tibble(res) + sparsevctrs::has_sparse_elements(res) ) expect_no_error( @@ -158,7 +158,7 @@ test_that("bake() accepts sparse matrices", { ) expect_true( - is_sparse_tibble(res) + sparsevctrs::has_sparse_elements(res) ) })