tests/testthat/test-accessdb.R

data <- tryCatch(sm_data("ELECTRICITY", from = 2000), error = function(e) NULL)

if(length(data) && fnrow(data) > 1L) test_that("reshaping works", {

  expect_equal(data, sm_pivot_wider(sm_pivot_longer(data)))

})

Try the samadb package in your browser

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

samadb documentation built on Aug. 21, 2025, 5:54 p.m.