Skip to content

Instantly share code, notes, and snippets.

@rCarto
Created February 28, 2020 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rCarto/3a8255bb2ee2dae299a5ae13925e0cd3 to your computer and use it in GitHub Desktop.
Save rCarto/3a8255bb2ee2dae299a5ae13925e0cd3 to your computer and use it in GitHub Desktop.
library(cartography)
library(sf)
mtq <- st_read(system.file("gpkg/mtq.gpkg",
package="cartography"))
bks <- getBreaks(v = mtq$MED, nclass = 5,
method = "quantile")
cols <- carto.pal(pal1 = "turquoise.pal", n1 = 5)
choroLayer(x = mtq, var = "MED",
breaks = bks, col = cols,
legend.pos = NA)
legendChoro(pos = unlist(locator(1)),
breaks = bks, col = cols,
nodata = FALSE)
north(pos = unlist(locator(1)))
barscale(pos = unlist(locator(1)), size = 5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment