data("nuts2006")
## Example 1
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
# Layout plot
layoutLayer(title = "Countries Population & Color in Europe",
sources = "UMS RIATE, 2015",
scale = NULL,
frame = TRUE,
col = "black",
coltitle = "white",
bg = "#D9F5FF",
extent = nuts0.spdf)
#Countries plot
plot(nuts0.spdf, col = "grey60",border = "grey20", add=TRUE)
nuts0.df$typo <- c(rep("A",10),rep("B",10),rep("C",10),rep("D",4))
nuts0.df$typo[1:3] <- NA
nuts0.df$pop2008[4:6] <- NA
propSymbolsTypoLayer(spdf = nuts0.spdf, df = nuts0.df,
var = "pop2008", var2="typo",
symbols = "circle",
legend.var.pos = "topright",
legend.var2.pos = "right",
legend.var.title.txt = "Total\npopulation (2008)",
legend.values.rnd = -3,
legend.var2.title.txt = "Category",
col = c("red","green","blue","yellow"),
legend.var2.values.order = c("D", "A", "B", "C"),
legend.var.style = "c")
Run the code above in your browser using DataLab