Description Usage Arguments Value Examples
This will then work with ggplot2
1 | make_tidy_poly(spatial)
|
spatial |
an object of class SpatialPolygonsDataFrame |
tibble
1 2 3 4 5 6 7 8 9 10 11 | library(geoDK)
library(ggplot2)
geo_reg <- geo_get_spatial("Danish regions")
df <- make_tidy_poly(geo_reg)
ggplot(df) +
geom_polygon(aes(x = lng, y = lat, group = area, fill = regionkode),
show.legend = FALSE) +
coord_cartesian()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.