Show the code
library(rnaturalearth) # natural earth data
library(ggplot2) # beautiful maps
library(dplyr) # data wrangling
library(sf) # simple (spatial) featuresMap projections exist because we are trying to take the round globe of the earth, and project it onto a 2 dimensional surface. Because a spherical globe can not be projected onto a flat surface without some distortion, different projections make different choices about the kind of distortion involved.
library(rnaturalearth) # natural earth data
library(ggplot2) # beautiful maps
library(dplyr) # data wrangling
library(sf) # simple (spatial) featuresmapdata <- ne_countries(scale = "medium", # medium scale
returnclass = "sf") # as sf objectAn orthographic projection represents the globe as a 3 dimensional view.
A Mercator projection represents the earth with perpendicular latitude and longitude. This projection can be helpful in some kinds of navigation, but areas of landmasses are distorted. As one approaches the poles, landmasses are over-sized, while landmasses closer to the equator are under-emphasized. Thus, this projection is often seen as one that does not properly acknowledge the size of countries in the Global South.
Antarctica can often not be correctly mapped with the Mercator projection. One way to avoid this difficulty is to employ a slightly more complicated procedure, removing Antarctica from the data before plotting.
mercator_data <- mapdata %>%
filter(name != "Antarctica") # remove Antarctica
ggplot(mercator_data) + # the data I am mapping
geom_sf() + # the geometry I am using
coord_sf(crs = 3857) + # Mercator
theme_minimal() + # minimal theme
theme(axis.text.x = element_blank()) # no longitude labelsThe Mollweide projection is an equal area projection. As a consequence, latitude and longitude lines are not perpendicular, and the shapes of some landmasses may appear to be distorted.
The Robinson projection is an attempt to compromise between equal areas and a natural looking map.