25 Antarctica

A cold continent that can’t be reached with Web Mercator.

Libraries

Code
library(sf)
library(tmap)
library(dplyr)
library(stringr)
library(ggplot2)

Data wrangling

Code
focus <- "Antarctica"
lon0 <- 0
lat0 <- -90
proj <- str_glue("+proj=ortho lon_0={lon0} lat_0={lat0}")

world <- st_read("data/ne_110m_admin_0_map_units.gpkg") %>%
  st_make_valid() %>%
  select(CONTINENT)

world_o <- world %>%
  st_transform(proj) %>%
  st_make_valid() %>%
  filter(!st_is_empty(.)) %>%
  group_by(CONTINENT) %>%
  summarise() 

continent <- world %>%
  filter(CONTINENT == focus)

The maps

tmap

tm_shape(world_o) +
  tm_fill() + 
  tm_shape(continent) +
  tm_fill(fill = "red") +
  tm_layout(frame = FALSE)

ggplot2

ggplot(world_o) +
  geom_sf(linewidth = 0) +
  geom_sf(
    data = continent, 
    fill = "red", 
    linewidth = 0) +
  theme_void()