library(rgdal)
library(broom)
dsn <- system.file('extdata', package = 'ggsn')
map <- readOGR(dsn, 'sp')
map@data$id <- 1:nrow(map@data)
map.df <- merge(tidy(map), map, by = 'id')
ggplot(map.df, aes(long, lat, group = group, fill = nots)) +
geom_polygon() +
coord_equal() +
geom_path() +
north(map.df) +
blank()
ggplot(map.df, aes(long, lat, group = group, fill = nots)) +
geom_polygon() +
coord_equal() +
geom_path() +
north(map.df)
Run the code above in your browser using DataLab