# NOT RUN {
## Example 1
library(sp)
data("nuts2006")
plot(nuts0.spdf, col = "grey60",border = "grey20")
nuts0.df$typo <- c(rep("A",10),rep("B",10),rep("C",10),rep("D",4))
propSymbolsTypoLayer(spdf = nuts0.spdf, df = nuts0.df,
var = "pop2008", var2="typo")
## Example 2
library(sf)
mtq <- st_read(system.file("shape/martinique.shp", package="cartography"))
# Countries plot
plot(st_geometry(mtq), col = "lightblue4",border = "lightblue3", bg = "lightblue1")
# Population plot on proportional symbols
propSymbolsTypoLayer(x = mtq, var = "P13_POP", var2 = "STATUT",
symbols = "circle",
col = c("aquamarine4", "yellow3","wheat"),
legend.var2.values.order = c("Pr<U+00E9>fecture de r<U+00E9>gion",
"Sous-pr<U+00E9>fecture",
"Commune simple"),
legend.var.pos = "right", border = "grey",
legend.var.title.txt = "Total\npopulation (2013)")
# Layout plot
layoutLayer(title = "Population in Martinique",
sources = "INSEE, 2016", theme = "blue.pal",
scale = NULL, frame = FALSE)
# }
Run the code above in your browser using DataLab