GDP per capita (current USD) - NY.GDP.PCAP.CD

Data - WDI

Info

Last observation: 2025 (N = 233)

First observation: 1960 (N = 151)

Last data update: 16 aoû 2026, 20:10. Last compile: 17 aoû 2026, 23:41

Nobs - Javascript

Code
NY.GDP.PCAP.CD |>
  left_join(iso2c, by = "iso2c") |>
  group_by(iso2c, Iso2c) |>
  mutate(value = round(value)) %>%
  summarise(Nobs = n(),
            `Year 1` = first(year),
            `GDP Per Capita 1` = first(value) %>% paste0("$ ", .),
            `Year 2` = last(year),
            `GDP Per Capita 2` = last(value) %>% paste0("$ ", .)) |>
  arrange(-Nobs) |>
  mutate(Flag = gsub(" ", "-", str_to_lower(Iso2c)),
         Flag = paste0('<img src="../../bib/flags/vsmall/', Flag, '.png" alt="Flag">')) |>
  select(Flag, everything()) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F, escape = F) else .}

Japan

Code
NY.GDP.PCAP.CD |>
  filter(iso2c %in% c("JP")) |>
  left_join(iso2c, by = "iso2c") |>
  year_to_enddate() |>
  ggplot() + geom_line(aes(x = date, y = value)) +
  xlab("") + ylab("GDP per capita") + theme_minimal() +
  theme(legend.title = element_blank(),
        legend.position = c(0.2, 0.2)) +
  scale_x_date(breaks = seq(1950, 2100, 5) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_log10(breaks = c(100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000, 100000, 200000),
                labels = dollar_format(acc = 1))

Ranking

All

Code
NY.GDP.PCAP.CD |>
  group_by(year) |>
  arrange(-value) |>
  mutate(rank = 1:n()) |>
  filter(iso2c %in% c("CH", "FR", "DE", "IT")) |>
  year_to_date() |>
  left_join(iso2c, by = "iso2c") |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  mutate(value = rank) |>
  ggplot() + xlab("") + ylab("Rank") +
  geom_line(aes(x = date, y = value, color = color)) + 
  theme_minimal() + scale_color_identity() + add_flags +
  scale_x_date(breaks = seq(1950, 2100, 10) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_reverse(breaks = c(1, seq(5, 50,5)))

Euro Area vs. US

Base 100

Code
NY.GDP.PCAP.CD |>
  left_join(iso2c, by = "iso2c") |>
  year_to_date() |>
  filter(iso2c %in% c("XC", "US"),
         date >= as.Date("2008-01-01")) |>
  group_by(iso2c) |>
  arrange(date) |>
  mutate(value = 100*value/value[1]) |>
  mutate(Iso2c = ifelse(iso2c == "XC", "Europe", Iso2c)) |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  mutate(color = ifelse(iso2c == "US", color2, color)) |>
  ggplot() + theme_minimal() + scale_color_identity() +
  geom_line(aes(x = date, y = value, color = color)) +
  add_flags +
  scale_x_date(breaks = seq(1950, 2100, 2) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(70, 200, 5)) + 
  xlab("") + ylab("PIB/habitant en $ (100 = 2008)")

Avec dollars

Code
NY.GDP.PCAP.CD |>
  left_join(iso2c, by = "iso2c") |>
  year_to_date() |>
  filter(iso2c %in% c("XC", "US"),
         date >= as.Date("2008-01-01")) |>
  group_by(iso2c) |>
  arrange(date) |>
  mutate(Iso2c = ifelse(iso2c == "XC", "Europe", Iso2c)) |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  mutate(color = ifelse(iso2c == "US", color2, color)) |>
  ungroup() |>
  mutate(dollar = value,
         value = 100*value/value[2]) |>
  ggplot() + theme_minimal() + scale_color_identity() +
  geom_line(aes(x = date, y = value, color = color)) +
  add_flags +
  scale_x_date(breaks = seq(1950, 2100, 2) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(10, 200, 5)) + 
  xlab("") + ylab("PIB/habitant en $ (100 = Zone Euro, 2008)") + 
  geom_text_repel(data = . %>% filter(year(date) %in% seq(2008, 2022, 2)),
                                      aes(x = date, y = value, label = paste0("$", round(dollar, digits = -2), " /hab")))

Euro area vs. US vs. France

Linear

Code
NY.GDP.PCAP.CD |>
  # XC: Euro area
  filter(iso2c %in% c("US", "XC", "FR")) |>
  left_join(iso2c, by = "iso2c") |>
  mutate(Iso2c = ifelse(iso2c == "XC", "Europe", Iso2c)) |>
  year_to_date() |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  mutate(color = ifelse(iso2c == "XC", color2, color)) |>
  ggplot() + xlab("") + ylab("GDP per capita") +
  geom_line(aes(x = date, y = value, color = color)) + 
  theme_minimal() + scale_color_identity() + add_flags +
  scale_x_date(breaks = seq(1950, 2100, 5) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = seq(0, 80000, 5000),
                labels = dollar_format(acc = 1))

Base 100 = 1960

Code
NY.GDP.PCAP.CD |>
  filter(iso2c %in% c("US", "XC", "FR")) |>
  left_join(iso2c, by = "iso2c") |>
  mutate(Iso2c = ifelse(iso2c == "XC", "Europe", Iso2c)) |>
  year_to_date() |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  mutate(color = ifelse(iso2c == "XC", color2, color)) |>
  group_by(iso2c, Iso2c) |>
  arrange(date) |>
  mutate(value = 100*value/value[1]) |>
  ggplot() + xlab("") + ylab("GDP per capita, 100 = 1960") +
  geom_line(aes(x = date, y = value, color = color)) + 
  theme_minimal() + scale_color_identity() + add_flags +
  scale_x_date(breaks = seq(1950, 2100, 5) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_log10(breaks =c(100, 200, 400, 800, 1000, 2000, 4000, 8000, 10000, 20000))

Base 100 = 1990

Code
NY.GDP.PCAP.CD |>
  filter(iso2c %in% c("US", "XC", "FR")) |>
  left_join(iso2c, by = "iso2c") |>
  mutate(Iso2c = ifelse(iso2c == "XC", "Europe", Iso2c)) |>
  year_to_date() |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  mutate(color = ifelse(iso2c == "XC", color2, color)) |>
  group_by(iso2c, Iso2c) |>
  arrange(date) |>
  filter(date >= as.Date("1990-01-01")) |>
  mutate(value = 100*value/value[1]) |>
  ggplot() + xlab("") + ylab("GDP per capita, 100 = 1990") +
  geom_line(aes(x = date, y = value, color = color)) + 
  theme_minimal() + scale_color_identity() + add_flags +
  scale_x_date(breaks = seq(1950, 2100, 2) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(100, 400, 10))

Base 100 = 2006

Code
NY.GDP.PCAP.CD |>
  filter(iso2c %in% c("US", "XC", "FR")) |>
  left_join(iso2c, by = "iso2c") |>
  mutate(Iso2c = ifelse(iso2c == "XC", "Europe", Iso2c)) |>
  year_to_date() |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  mutate(color = ifelse(iso2c == "XC", color2, color)) |>
  group_by(iso2c, Iso2c) |>
  arrange(date) |>
  filter(date >= as.Date("2006-01-01")) |>
  mutate(value = 100*value/value[1]) |>
  ggplot() + xlab("") + ylab("GDP per capita, 100 = 2006") +
  geom_line(aes(x = date, y = value, color = color)) + 
  theme_minimal() + scale_color_identity() + add_flags +
  scale_x_date(breaks = seq(1950, 2100, 2) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(10, 400, 5))

Base 100 = 2007

Code
NY.GDP.PCAP.CD |>
  filter(iso2c %in% c("US", "XC", "FR")) |>
  left_join(iso2c, by = "iso2c") |>
  mutate(Iso2c = ifelse(iso2c == "XC", "Europe", Iso2c)) |>
  year_to_date() |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  mutate(color = ifelse(iso2c == "XC", color2, color)) |>
  group_by(iso2c, Iso2c) |>
  arrange(date) |>
  filter(date >= as.Date("2007-01-01")) |>
  mutate(value = 100*value/value[1]) |>
  ggplot() + xlab("") + ylab("GDP per capita, 100 = 2007") +
  geom_line(aes(x = date, y = value, color = color)) + 
  theme_minimal() + scale_color_identity() + add_flags +
  scale_x_date(breaks = seq(1950, 2100, 1) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(10, 400, 5))

Base 100 = 2008

Code
NY.GDP.PCAP.CD |>
  filter(iso2c %in% c("US", "XC", "FR")) |>
  left_join(iso2c, by = "iso2c") |>
  mutate(Iso2c = ifelse(iso2c == "XC", "Europe", Iso2c)) |>
  year_to_date() |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  mutate(color = ifelse(iso2c == "XC", color2, color)) |>
  group_by(iso2c, Iso2c) |>
  arrange(date) |>
  filter(date >= as.Date("2008-01-01")) |>
  mutate(value = 100*value/value[1]) |>
  ggplot() + xlab("") + ylab("GDP per capita, 100 = 2008") +
  geom_line(aes(x = date, y = value, color = color)) + 
  theme_minimal() + scale_color_identity() + add_flags +
  scale_x_date(breaks = seq(1950, 2100, 1) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(10, 400, 5))

Switzerland, France, Germany, USA

1970-

Code
NY.GDP.PCAP.CD |>
  filter(iso2c %in% c("CH", "FR", "DE", "US")) |>
  year_to_date() |>
  #filter(date >= as.Date("1970-01-01")) %>%
  left_join(iso2c, by = "iso2c") |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  mutate(color = ifelse(iso2c == "FR", color2, color)) |>
  arrange(date) |>
  ggplot() + xlab("") + ylab("GDP per capita") + 
  geom_line(aes(x = date, y = value, color = color)) + 
  theme_minimal() + scale_color_identity() + add_flags +
  scale_x_date(breaks = seq(1963, 2100, 5) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_log10(breaks = c(100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000, 100000),
                labels = dollar_format(acc = 1))

Switzerland, France, Germany, Italy, UK

All

Code
NY.GDP.PCAP.CD |>
  filter(iso2c %in% c("CH", "FR", "DE", "IT", "GB", "US")) |>
  year_to_date() |>
  left_join(iso2c, by = "iso2c") |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  mutate(color = ifelse(iso2c == "FR", color2, color)) |>
  arrange(date) |>
  ggplot() + xlab("") + ylab("GDP per capita") + 
  geom_line(aes(x = date, y = value, color = color)) + 
  theme_minimal() + scale_color_identity() + add_flags +
  scale_x_date(breaks = seq(1950, 2100, 10) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_log10(breaks = c(100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000, 100000),
                labels = dollar_format(acc = 1))

1990-

Code
NY.GDP.PCAP.CD |>
  filter(iso2c %in% c("CH", "FR", "DE", "IT", "GB", "US")) |>
  year_to_date() |>
  left_join(iso2c, by = "iso2c") |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  mutate(color = ifelse(iso2c == "FR", color2, color)) |>
  filter(date >= as.Date("1990-01-01")) |>
  ggplot() + xlab("") + ylab("GDP per capita") +
  geom_line(aes(x = date, y = value, color = color)) + 
  theme_minimal() + scale_color_identity() + add_flags +
  scale_x_date(breaks = seq(1950, 2100, 5) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(10000, 100000, 10000),
                labels = dollar_format(acc = 1))

Switzerland, France, Germany, Italy, UK

All

Code
NY.GDP.PCAP.CD |>
  filter(iso2c %in% c("CH", "FR", "DE", "IT", "GB")) |>
  year_to_date() |>
  left_join(iso2c, by = "iso2c") |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  mutate(color = ifelse(iso2c == "FR", color2, color)) |>
  arrange(date) |>
  ggplot() + xlab("") + ylab("GDP per capita") + 
  geom_line(aes(x = date, y = value, color = color)) + 
  theme_minimal() + scale_color_identity() + add_flags +
  scale_x_date(breaks = seq(1950, 2100, 10) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_log10(breaks = c(100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000, 100000),
                labels = dollar_format(acc = 1))

1990-

Code
NY.GDP.PCAP.CD |>
  filter(iso2c %in% c("CH", "FR", "DE", "IT", "GB")) |>
  year_to_date() |>
  left_join(iso2c, by = "iso2c") |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  mutate(color = ifelse(iso2c == "FR", color2, color)) |>
  filter(date >= as.Date("1990-01-01")) |>
  ggplot() + xlab("") + ylab("GDP per capita") +
  geom_line(aes(x = date, y = value, color = color)) + 
  theme_minimal() + scale_color_identity() + add_flags +
  scale_x_date(breaks = seq(1950, 2100, 5) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(10000, 100000, 10000),
                labels = dollar_format(acc = 1))

Switzerland, France

All

Code
NY.GDP.PCAP.CD |>
  filter(iso2c %in% c("CH", "FR")) |>
  year_to_date() |>
  left_join(iso2c, by = "iso2c") |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  mutate(color = ifelse(iso2c == "FR", color2, color)) |>
  
  arrange(date) |>
  ggplot() + xlab("") + ylab("GDP per capita") + 
  geom_line(aes(x = date, y = value, color = color)) + 
  theme_minimal() + scale_color_identity() + add_flags +
  scale_x_date(breaks = seq(1950, 2100, 10) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_log10(breaks = c(100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000, 100000),
                labels = dollar_format(acc = 1))

1990-

Code
NY.GDP.PCAP.CD |>
  filter(iso2c %in% c("CH", "FR")) |>
  year_to_date() |>
  left_join(iso2c, by = "iso2c") |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  
  filter(date >= as.Date("1990-01-01")) |>
  ggplot() + xlab("") + ylab("GDP per capita") +
  geom_line(aes(x = date, y = value, color = color)) + 
  theme_minimal() + scale_color_identity() + add_flags +
  scale_x_date(breaks = seq(1950, 2100, 5) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(10000, 100000, 10000),
                labels = dollar_format(acc = 1))

United States, Japan, China, Europe

Code
NY.GDP.PCAP.CD |>
  filter(iso2c %in% c("US", "JP", "CN", "EU")) |>
  year_to_date() |>
  left_join(iso2c, by = "iso2c") |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  
  ggplot() + xlab("") + ylab("GDP per capita") +
  geom_line(aes(x = date, y = value, color = color)) + 
  theme_minimal() + scale_color_identity() + add_flags +
  scale_x_date(breaks = seq(1950, 2100, 5) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_log10(breaks = c(100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000, 100000),
                labels = dollar_format(acc = 1))

United States, Japan, China, Europe, France, Germany

Code
NY.GDP.PCAP.CD |>
  filter(iso2c %in% c("US", "JP", "CN", "EU", "FR", "DE")) |>
  year_to_date() |>
  left_join(iso2c, by = "iso2c") |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  
  ggplot() + xlab("") + ylab("GDP per capita") +
  geom_line(aes(x = date, y = value, color = color)) + 
  theme_minimal() + scale_color_identity() + add_flags +
  scale_x_date(breaks = seq(1950, 2100, 5) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_log10(breaks = c(100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000, 100000),
                labels = dollar_format(acc = 1))

United States, Japan, China

Log

Code
plot_log <- NY.GDP.PCAP.CD |>
  filter(iso2c %in% c("US", "JP", "CN")) |>
  year_to_date() |>
  left_join(iso2c, by = "iso2c") |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  
  ggplot() + xlab("") + ylab("GDP per capita") +
  geom_line(aes(x = date, y = value, color = color)) + 
  theme_minimal() + scale_color_identity() + add_flags +
  theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1)) +
  scale_x_date(breaks = seq(1950, 2100, 5) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_log10(breaks = c(100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000, 100000),
                labels = dollar_format(acc = 1))

plot_log

Linéaire

Code
plot_linear <- NY.GDP.PCAP.CD |>
  filter(iso2c %in% c("US", "JP", "CN")) |>
  year_to_date() |>
  left_join(iso2c, by = "iso2c") |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  
  ggplot() + xlab("") + ylab("GDP per capita") +
  geom_line(aes(x = date, y = value, color = color)) + 
  theme_minimal() + scale_color_identity() + add_flags +
  theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1)) +
  scale_x_date(breaks = seq(1950, 2100, 5) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = seq(0, 100000, 5000),
                     labels = dollar_format(acc = 1))

plot_linear

Bind

Code
ggpubr::ggarrange(plot_linear + ggtitle("Linear Scale"), plot_log  + ggtitle("Log Scale"), common.legend = T)

China, France, Germany

Code
NY.GDP.PCAP.CD |>
  filter(iso2c %in% c("CN", "FR", "DE")) |>
  year_to_date() |>
  left_join(iso2c, by = "iso2c") |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  
  ggplot() + xlab("") + ylab("GDP per capita") +
  geom_line(aes(x = date, y = value, color = color)) + 
  theme_minimal() + scale_color_identity() + add_flags +
  scale_x_date(breaks = seq(1950, 2100, 5) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_log10(breaks = c(100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000, 100000),
                labels = dollar_format(acc = 1))

Italy, Portugal, Spain

Code
NY.GDP.PCAP.CD |>
  filter(iso2c %in% c("ES", "IT", "PT")) |>
  year_to_date() |>
  left_join(iso2c, by = "iso2c") |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  
  ggplot() + xlab("") + ylab("GDP per capita") +
  geom_line(aes(x = date, y = value, color = color)) + 
  theme_minimal() + scale_color_identity() + add_flags +
  scale_x_date(breaks = seq(1950, 2100, 5) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_log10(breaks = c(100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000, 100000),
                labels = dollar_format(acc = 1))

Spain, United Kingdom, United States

Code
NY.GDP.PCAP.CD |>
  filter(iso2c %in% c("US", "GB", "ES")) |>
  year_to_date() |>
  left_join(iso2c, by = "iso2c") |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  
  ggplot() + xlab("") + ylab("GDP per capita") +
  geom_line(aes(x = date, y = value, color = color)) + 
  theme_minimal() + scale_color_identity() + add_flags +
  scale_x_date(breaks = seq(1950, 2100, 5) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_log10(breaks = c(100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000, 100000),
                labels = dollar_format(acc = 1))

Argentina, Chile, Venezuela

Code
NY.GDP.PCAP.CD |>
  filter(iso2c %in% c("AR", "CL", "VE")) |>
  year_to_date() |>
  left_join(iso2c, by = "iso2c") |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  
  ggplot() + xlab("") + ylab("GDP per capita") +
  geom_line(aes(x = date, y = value, color = color)) + 
  theme_minimal() + scale_color_identity() + add_flags +
  scale_x_date(breaks = seq(1950, 2100, 5) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_log10(breaks = c(100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000, 100000),
                labels = dollar_format(acc = 1))

United States, France, Greece

All

Code
NY.GDP.PCAP.CD |>
  filter(iso2c %in% c("GR", "FR", "US")) |>
  year_to_date() |>
  left_join(iso2c, by = "iso2c") |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  
  ggplot() + xlab("") + ylab("GDP per capita") +
  geom_line(aes(x = date, y = value, color = color)) + 
  theme_minimal() + scale_color_identity() + add_flags +
  scale_x_date(breaks = seq(1950, 2100, 5) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_log10(breaks = c(100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000, 100000),
                labels = dollar_format(acc = 1))

2000-

Code
NY.GDP.PCAP.CD |>
  filter(iso2c %in% c("GR", "FR", "US")) |>
  year_to_date() |>
  left_join(iso2c, by = "iso2c") |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  
  filter(date >= as.Date("2000-01-01")) |>
  mutate(color = ifelse(iso2c == "US", color2, color)) |>
  ggplot() + xlab("") + ylab("GDP per capita") +
  geom_line(aes(x = date, y = value, color = color)) + 
  theme_minimal() + scale_color_identity() + add_flags +
  scale_x_date(breaks = seq(1950, 2100, 2) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = seq(10000, 70000, 5000),
                labels = dollar_format(acc = 1))

Greece, Hong Kong, Mexico

Code
NY.GDP.PCAP.CD |>
  filter(iso2c %in% c("GR", "HK", "MX")) |>
  year_to_date() |>
  left_join(iso2c, by = "iso2c") |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  
  ggplot() + xlab("") + ylab("GDP per capita") +
  geom_line(aes(x = date, y = value, color = color)) + 
  theme_minimal() + scale_color_identity() + add_flags +
  scale_x_date(breaks = seq(1950, 2100, 5) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_log10(breaks = c(100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000, 100000),
                labels = dollar_format(acc = 1))