# 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 = "magenta.pal", n1 = 2, pal2 = "blue.pal", n2 = 4)
# plot backgroud shapes (sea and world)
plot(nuts0.spdf, border = NA, col = NA, bg = "#00FFFF")
plot
R语言绘制带制图包的定制欧洲地图1
最新推荐文章于 2023-08-26 01:00:55 发布