inst/tinytest/test_getFigDim.R

library(sf)
library(sp)
mtq <- st_read(system.file("gpkg/mtq.gpkg", package="cartography"), quiet = TRUE)
expect_equal(getFigDim(x = mtq, width = 500, mar = c(0,0,0,0), res = 100), c(500,585))
expect_equal(getFigDim(x = as(mtq, "Spatial"), width = 500, mar = c(0,0,0,0), res = 100), c(500,585))
expect_equal(getFigDim(x = mtq, height = 585, mar = c(0,0,0,0), res = 100), c(499,585))
expect_error(getFigDim(spdf = as(mtq, "Spatial"), mar = c(0,0,0,0), res = 100))
  

Try the cartography package in your browser

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

cartography documentation built on Sept. 14, 2023, 5:08 p.m.