Nothing
context("read_statistical_grid")
# skip tests because they take too much time
testthat::skip_on_cran()
skip_if(Sys.getenv("TEST_ONE") != "")
test_that("read_statistical_grid", {
temp <- read_statistical_grid(year=2010, code_muni="all", output = "arrow")
testthat::expect_true( nrow(temp) == 13286535 )
temp <- read_statistical_grid(year=2010, code_muni="AC", output = "arrow")
testthat::expect_true( nrow(temp) == 183695 )
temp <- read_statistical_grid(year=2010, code_muni=2927408, output = "arrow")
testthat::expect_true( nrow(temp) == 17254 )
testthat::expect_true(is(temp, "ArrowObject"))
temp <- read_statistical_grid(year=2010, code_muni=2927408, output = "duckdb")
testthat::expect_true(is(temp, "duckspatial_df"))
temp <- read_statistical_grid(year=2010, code_muni=2927408, output = "sf")
testthat::expect_true("sf" %in% class(temp))
})
# ERRORS
test_that("read_statistical_grid", {
# Wrong year and code
testthat::expect_error(read_statistical_grid())
testthat::expect_error(read_statistical_grid(code_muni=NULL))
# Wrong code
testthat::expect_error(read_statistical_grid(code_muni=9999999))
# Wrong year
testthat::expect_error(read_statistical_grid(code_muni="AC"))
testthat::expect_error(read_statistical_grid( year=9999999))
# Wrong output
testthat::expect_error(
read_statistical_grid(year=2022, code_muni="AC", output = "banana")
)
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.