World map

The map_data function reads geographic data. Options include “world”, “world2” (Pacific centred), “usa”, “italy”, “nz”

library(tidyverse)
── Attaching packages ─────────────────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse 1.2.1 ──
✔ ggplot2 2.2.1     ✔ purrr   0.2.5
✔ tibble  1.4.2     ✔ dplyr   0.7.5
✔ tidyr   0.8.1     ✔ stringr 1.3.1
✔ readr   1.1.1     ✔ forcats 0.3.0
── Conflicts ────────────────────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
map_data("world2") %>% ggplot(aes(x=long, y=lat, group=group)) + geom_polygon()

Attaching package: ‘maps’

The following object is masked from ‘package:purrr’:

    map

head(map_data("world2"))
map_data("world") %>% 
  filter(region %in% c("Sweden", "Norway", "Finland", "Denmark")) %>%
  ggplot(aes(x=long, y=lat, group=group)) + geom_polygon()