# Cartography Library
library(cartography)
library(sp)# Upload data attached with the package.
data(nuts2006)# Now we have a spdf file (shape file) called nuts2.spdf with shape of european regions.# We also have a dataframe with information concerning every region.Both object have a first column "id" that makes the link between them.
head(nuts2.df)# Annual growth per region
nuts2.df$cagr<- 100 * (((nuts2.df$pop2008/nuts2.df$pop1999)^(1/9)) - 1)# Build a color palette
cols <- carto.pal(pal1 ="green.pal", n1 =2, pal2 ="pink.pal", n2 =4)