# NOT RUN {
library(sp)
library(sf)
data("nuts2006")
# Create a link layer
head(twincities.df)
# Select links from Ireland (IE)
twincitiesIE <- twincities.df[substr(twincities.df$i,1,2)=="IE", ]
twincities.sf <- getLinkLayer(x = nuts2.spdf, df = twincitiesIE, dfid = c("i", "j"))
# Plot the links
plot(nuts2.spdf, col = "#6C6870")
plot(st_geometry(twincities.sf), col = "#F78194", add = TRUE)
# }
Run the code above in your browser using DataLab