Sunday, March 1, 2026

Pacific island inhabitants pyramids (once more)


This put up is the fifth of a sequence of seven on inhabitants points within the Pacific, re-generating the charts I utilized in a keynote speech earlier than the November 2025 assembly of the Pacific Heads of Planning and Statistics in Wellington, New Zealand. The seven items of the puzzle are:

Immediately’s put up is about inhabitants pyramids, and is acquainted territory for normal readers of the weblog, if any. The code is principally an adaptation of that used to create these animated inhabitants pyramids, tweaked to create nonetheless photos that I wanted to make the purpose in my speak.

Kiribati and Marshall Islands

Within the first occasion that meant this picture, which contrasts the demographic form and development of two coral atoll nations, Kiribati and Marshall Islands:

Kiribati right this moment has about 4 occasions the inhabitants of Marshall Islands however in 1980 was solely about double. The numerous factor right here is the wasp waist of the Marshall Islands pyramid in 2025—whereas it had the same form to Kiribati in 1980. Individuals at peak working and reproductive age are actually absent from right this moment’s Marshall Islands—on this case, primarily within the USA, which provides automated residence rights to the Compact of Free Affiliation Nations (Marshall Islands, Palau and Federated States of Micronesia).

The results of that is that Marshall Islands not solely advantages from its people having extra freedom of motion and alternative, and sending again remittances; but in addition having a strain valve for what would in any other case be a quickly (too quick?) rising inhabitants. To place it bluntly, Kiribati has an issue of too many individuals (notably on crowded southern Tarawa); Marshall Islands, if it has a inhabitants drawback, is one among too few. The distinction of crowded, comparatively poor Tarawa and less-crowded, comparatively well-off Majuro is an apparent and stark one to anybody travelling to them each in fast succession.

That first chart tries to point out each absolutely the dimension and form on the identical time. Another presentation lets the x axis be free, giving up comparability of dimension however making modifications in form extra seen. There are professionals and cons of every however the free axis model actually dramatically reveals the change in form of Marshall Islands specifically:

Right here’s the code to obtain the info from the Pacific Information Hub and draw these charts:

# this script attracts inhabitants pyramids for 1980 and 2025, firstly
# for Marshall Islands and Kiribati collectively for comparability 
# functions, after which for every of the 21 PICTs (exlcuding Pitcairn)
# so we will decide and select which of them
#
# Peter Ellis November 2025

library(tidyverse)
library(janitor)
library(rsdmx)
library(ISOcodes)
library(glue)

# see https://weblog.datawrapper.de/gendercolor/
pal <- c("#D4855A", "#C5CB81")
names(pal) <- c("Feminine", "Male")

# Obtain all inhabitants information wanted
if(!exists("pop2picts"))> 
    as_tibble() 

# kind out the from and to ages, rename intercourse, and add nation labels
d <- pop2picts |> 
  mutate(age = gsub("^Y", "", age)) |>
  separate(age, into = c("from", "to"), sep = "T", take away = FALSE) |>
  mutate(age = gsub("T", "-", age),
         age = gsub("-999", "+", age, mounted = TRUE),
         intercourse = case_when(
           intercourse == "M" ~ "Male",
           intercourse == "F" ~ "Feminine"
         )) |>
  mutate(age = issue(age)) |>
  left_join(ISO_3166_1, by = c("geo_pict" = "Alpha_2")) |>
  rename(pict = Identify) |> 
  filter(time_period %in% c(1980, 2025))

#----------Marshalls and Kiribati-------------
# subset information to those two international locations:
d1 <- d |> 
  filter(pict %in% c("Kiribati", "Marshall Islands"))

# breaks in axis for Marshall and Kiribati chart:
x_breaks <- c(-6000, - 4000, -2000, 0, 2000, 4000, 6000)

# draw chart:
pyramid_km <- d1 |> 
  # in keeping with Wikipedia males are normally on the left and females on the best
  filter(intercourse == "Feminine") |> 
  ggplot(aes(y = age)) +
  facet_grid(pict ~ time_period) +
  geom_col(aes(x = obs_value), fill = pal['Female']) +
  geom_col(information = filter(d1, intercourse == "Male"), aes(x = -obs_value), fill = pal['Male']) +
  labs(x = "", y = "Age group") +
  scale_x_continuous(breaks = x_breaks, labels = c("6,000", "4,000", "2,000n(male)", 0 , 
                                                   "2,000n(feminine)", "4,000", "6,000")) +
  theme(panel.grid.minor = element_blank(),
        strip.textual content = element_text(dimension = 14, face = "daring"))

print(pyramid_km)

pyramid_km_fr <- pyramid_km  +
  facet_wrap(pict ~ time_period, scales = "free_x") 

print(pyramid_km_fr)

All Pacific island international locations, separately

I used the identical chart to generate a PNG picture of every Pacific island nation, separately. Within the precise speak I pulled just a few of those in to the PowerPoint to interact the viewers and distinction totally different shapes. These plots are all sized to slot in to at least one body within the PowerPoint template I used to be utilizing.

For instance, right here is Tuvalu:

Till very just lately, it has been comparatively troublesome emigrate out from Tuvalu. In consequence we see a kind of common inhabitants pyramid for a rustic within the late stage of demographic transition.

In distinction, right here is French territory Wallis and Futuna:

Wallis and Futuna’s inhabitants can transfer freely to different French territories resembling New Caledonia, and have completed so in appreciable numbers. Therefore we see a scarcity within the 25-39 12 months age bracket.

Right here’s the code to provide these pyramids for particular person international locations, saving them neatly in a folder for future use. Sure, I all the time use loops for this kind of factor, discovering them each simple to put in writing and to learn (and saying loops are by no means any good in R is simply outmoded prejudice):

#--------------population pyramid particular person picture for every pict-----------
# This part attracts one chart and saves as a picture for every PICT
dir.create("pic-pyramids", showWarnings = FALSE)

all_picts <- distinctive(d$pict)

for(this_pict in all_picts){
  this_d <- d |> 
    filter(pict == this_pict)

  this_pyramid <- this_d  |> 
    filter(intercourse == "Feminine") |> 
    ggplot(aes(y = age)) +
    facet_grid(pict ~ time_period) +
    geom_col(aes(x = obs_value), fill = pal['Female']) +
    geom_col(information = filter(this_d, intercourse == "Male"), aes(x = -obs_value), fill = pal['Male']) +
    labs(x = "", y = "Age group") +
    theme(panel.grid.minor = element_blank(),
          strip.textual content = element_text(dimension = 14, face = "daring"))

  png(glue("pic-pyramids/pyramid-{this_pict}.png"), width = 5000, top = 2800, 
      res = 600, sort = "cairo-png")
  print(this_pyramid)
  dev.off()

}

That’s all for right this moment. The ultimate put up within the sequence will say extra concerning the implications of all this within the context of the opposite bits of research.



Related Articles

Latest Articles