library(arc2r) library(sf) library(tmap)
# Point dataset depicting the train stations locations across Switzerland data("haltestelle_bahn") # Dataset depicting Switzerland on canton level data("kantonsgebiet") kanton_filter <- filter(kantonsgebiet, NAME %in% c("Zürich","St. Gallen","Thurgau","Aargau")) plot(st_geometry(haltestelle_bahn)) plot(st_geometry(kanton_filter), col = "grey", add = TRUE,alpha = 1)
haltestelle_bahn_clipped <- st_intersection(kanton_filter, haltestelle_bahn)
plot(st_geometry(haltestelle_bahn_clipped)) plot(st_geometry(kanton_filter), add = TRUE,alpha = 1)
haltestellen_split <- split(haltestelle_bahn_clipped,haltestelle_bahn_clipped$name) str(haltestellen_split[1:2])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.