# NOT RUN {
library(sp)
data("nuts2006")
# Create a link layer
twincities.spdf <- getLinkLayer(x = nuts2.spdf, df = twincities.df)
# Plot the links - Twin cities agreements between regions
plot(nuts0.spdf, col = "grey60",border = "grey20")
# Countries of agreements
twincities.df$ctry <- substr(twincities.df$j,1,2)
# Agreements with german cities
twincitiesok <- twincities.df[substr(twincities.df$i,1,2)=="DE",]
# plot the colored and graduated links
gradLinkTypoLayer(x = twincities.spdf, df = twincitiesok,
var = "fij", breaks = c(5,10,15,20),
lwd = c(1,4,8),
var2 = "ctry", add = TRUE)
# }
Run the code above in your browser using DataLab