| Title: | Easily Tidy Gapminder Datasets |
|---|---|
| Description: | A toolset that allows you to easily import and tidy data sheets retrieved from Gapminder data web tools. It will therefore contribute to reduce the time used in data cleaning of Gapminder indicator data sheets as they are very messy. |
| Authors: | Anicet Ebou [aut, cre] (ORCID: <https://orcid.org/0000-0003-4005-177X>) |
| Maintainer: | Anicet Ebou <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 1.0.0 |
| Built: | 2026-05-18 02:48:34 UTC |
| Source: | https://github.com/ebedthan/tidygapminder |
Applies tidy_index to all Gapminder data sheets found in a
directory and optionally combines them into a single data frame.
tidy_bunch(dirpath = ".", combine = FALSE, ...)tidy_bunch(dirpath = ".", combine = FALSE, ...)
dirpath |
Path to folder containing indices Gapminder indicator data sheets. Defaults to the current working directory. |
combine |
A boolean. If |
... |
Additional arguments (reserved for future use). |
If combine = FALSE (default), a named list of tibbles, one per file.
If combine = TRUE, a single tibble with all indicators merged by
country and year.
folder_path <- system.file("extdata", package = "tidygapminder") tidy_bunch(folder_path) tidy_bunch(folder_path, combine = TRUE)folder_path <- system.file("extdata", package = "tidygapminder") tidy_bunch(folder_path) tidy_bunch(folder_path, combine = TRUE)
Tidy a Gapminder indicator data sheet.
tidy_index(filepath) tidy_indice(filepath)tidy_index(filepath) tidy_indice(filepath)
filepath |
Path to a Gapminder indicator data sheet (.csv, .xlsx, or .xls). |
The indicator data sheet as a tidy data frame with columns
country, year, and the indicator name.
csv_filepath <- system.file("extdata/life_expectancy_years.csv", package = "tidygapminder") xlsx_filepath <- system.file( "extdata/agriculture_land.xlsx", package = "tidygapminder") tidy_index(csv_filepath) tidy_index(xlsx_filepath)csv_filepath <- system.file("extdata/life_expectancy_years.csv", package = "tidygapminder") xlsx_filepath <- system.file( "extdata/agriculture_land.xlsx", package = "tidygapminder") tidy_index(csv_filepath) tidy_index(xlsx_filepath)