inst/tinytest/test_discLayer.R

library(sf)
library(sp)
mtq <- st_read(system.file("gpkg/mtq.gpkg", package="cartography"), quiet = TRUE)
mtq.borders <- getBorders(x = mtq)
plot(st_geometry(mtq))
expect_silent(discLayer(x = mtq.borders, df = mtq,
                        var = "MED", col="red4", nclass=3,
                        method="equal", threshold = 0.4, sizemin = 0.5,
                        sizemax = 10, type = "abs",legend.values.rnd = 0,
                        legend.title.txt = "Discontinuities\n(absolute difference)",
                        legend.pos = "bottomleft", add=TRUE))
expect_silent(discLayer(x = mtq.borders, df = mtq,
                        var = "MED", col="red4", nclass=3,
                        method="equal", threshold = 0.4, sizemin = 0.5,
                        sizemax = 10, type = "rel",legend.values.rnd = 0,
                        legend.title.txt = "Discontinuities\n(absolute difference)",
                        legend.pos = "bottomleft", add=TRUE))
expect_error(discLayer(spdf = mtq.borders))

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.