inst/tinytest/test_legendHatched.R

library(sf)

mtq <- st_read(system.file("gpkg/mtq.gpkg", package="cartography"), quiet = TRUE)
plot(st_geometry(mtq))
expect_silent(legendHatched(categ=c("a","b"), patterns = c("dot","diamond"), col="red"))
expect_error(legendHatched(categ=c("a","b"), patterns = c("dot","aa")))
expect_silent(legendHatched(categ=c("a","b","c"), patterns = c("dot","diamond","text"), frame = TRUE, lty = 2))

expect_silent(legendHatched(pos="Err", categ=c("a","b"), patterns = c("dot","diamond")))

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.