Show the code
library(rnaturalearth) # natural earth data
library(ggplot2) # beautiful maps
library(dplyr) # data wrangling
library(sf) # simple (spatial) features
rnaturalearth
rnaturalearth
is a source library for data various types of global mapping data.
library(rnaturalearth) # natural earth data
library(ggplot2) # beautiful maps
library(dplyr) # data wrangling
library(sf) # simple (spatial) features
mapdata
As sf
ne_countries
stands for Natural Earth Countries.
I use ne_countries()
to create the mapdata
dataset as an sf
object (Chapter 7).
<- ne_countries(scale = "medium", # medium scale
mapdata returnclass = "sf") # as sf object
I make a simple map of this sf
object with ggplot
(Chapter 14).