library(tidyverse)
library(sf)
library(units)
library(tmap)
"~/data/adminexpress/adminexpress_cog_simpl_000_2022.gpkg" |>
read_sf(layer = "departement") |>
filter(!is.na(nom)) |>
mutate(surf_km2 = set_units(st_area(geom), km^2),
rank = dense_rank(surf_km2),
nom_dep = fct_rev(fct_reorder(as_factor(nom), rank))) |>
tm_shape() +
tm_polygons(fill = "lightgrey") +
tm_facets(by = "nom_dep", free.scales = TRUE)
Day 12 of 30DayMapChallenge: « scales » (previously).
French « départements » at the same size but tidily ordered by area, using data from Adminexpress made in Simplifying polygons layers.