tests/testthat/test-data-mask.R

test_that("Empty matrix can be coerced to a data frame (#7004)", {
  skip_if_not(getRversion() >= "4.4")
  expect_equal(
    slice(as.data.frame(matrix(nrow = 0, ncol = 0)), 1),
    data.frame()
  )
})

Try the dplyr package in your browser

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

dplyr documentation built on Feb. 3, 2026, 9:08 a.m.