# NOT RUN {
library(sp)
data("nuts2006")
plot(nuts0.spdf)
box()
var <- round((nuts0.df$pop2008 / sum(nuts0.df$pop2008))*100,2)
var2 <- round((nuts0.df$gdppps2008 / sum(nuts0.df$gdppps2008))*100,2)
r <- sqrt(var)/2*1000000
r2 <- sqrt(var2)/2*1000000
legendPropTriangles(pos = "topright", var.txt = "population totale (habs)",
var2.txt = "pib (euros)", title.txt="PIB par habitant",
title.cex = 0.8, values.cex = 0.6, cex = 1,
var = var, var2 = var2, r = r, r2 = r2,
col="green", col2="yellow", frame=TRUE, values.rnd=2,
style="c")
# }
Run the code above in your browser using DataLab