30/10/2025

The Gapminder Data

  • read more about the data here
  • here’s a peek at the data
    country continent year lifeExp pop gdpPercap
    Afghanistan Asia 1952 28.801 8425333 779.4453
    Afghanistan Asia 1957 30.332 9240934 820.8530
    Afghanistan Asia 1962 31.997 10267083 853.1007
    Afghanistan Asia 1967 34.020 11537966 836.1971
    Afghanistan Asia 1972 36.088 13079460 739.9811
    Afghanistan Asia 1977 38.438 14880372 786.1134

Animation with ggplotly

Thanks for viewing my presentation!

Here’s the code for the plot

gg <- ggplot(gapminder, aes(gdpPercap, lifeExp, color = continent)) +
    geom_point(aes(
        size = pop,
        frame = year,
        ids = country,
        alpha = 0.3
    )) +
    scale_x_log10(labels = scales::dollar_format())

ggplotly(gg)