https://github.com/jennybc/gapminder
Excerpt from the Gapminder data, as an R data package and in plain text delimited form
https://github.com/jennybc/gapminder
Last synced: 5 days ago
JSON representation
Excerpt from the Gapminder data, as an R data package and in plain text delimited form
- Host: GitHub
- URL: https://github.com/jennybc/gapminder
- Owner: jennybc
- Created: 2014-10-25T05:40:13.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2024-10-16T15:20:28.000Z (6 months ago)
- Last Synced: 2025-04-10T06:04:38.503Z (6 days ago)
- Language: R
- Homepage: http://jennybc.github.io/gapminder/
- Size: 22.9 MB
- Stars: 295
- Watchers: 22
- Forks: 678
- Open Issues: 1
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
- jimsghstars - jennybc/gapminder - Excerpt from the Gapminder data, as an R data package and in plain text delimited form (R)
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
## so jittered figs don't always appear to be changed
set.seed(1)
```# gapminder
[](https://doi.org/10.5281/zenodo.594018)
[](https://CRAN.R-project.org/package=gapminder)

[](https://github.com/jennybc/gapminder/actions/workflows/R-CMD-check.yaml)This repo is a data package with an excerpt from the [Gapminder](https://www.gapminder.org/data/) data.
The main object in this package is the `gapminder` data frame or "tibble".
There are other goodies, such as the data in tab delimited form, a larger unfiltered dataset, premade color schemes for the countries and continents, and ISO 3166-1 country codes.
The primary use case is for teaching and writing examples.## Installation
Install `gapminder` from CRAN:
```{r eval = FALSE}
install.packages("gapminder")
```## Quick look
Here we do a bit of data aggregation and plotting with the `gapminder` data:
```{r test-drive, message = FALSE, warning = FALSE, out.width = "60%"}
library(gapminder)
library(dplyr)
library(ggplot2)aggregate(lifeExp ~ continent, gapminder, median)
gapminder %>%
filter(year == 2007) %>%
group_by(continent) %>%
summarise(lifeExp = median(lifeExp))ggplot(gapminder, aes(x = continent, y = lifeExp)) +
geom_boxplot(outlier.colour = "hotpink") +
geom_jitter(position = position_jitter(width = 0.1, height = 0), alpha = 1 / 4)
```For more, see the [Get started](https://jennybc.github.io/gapminder/articles/gapminder.html) vignette.