Package 'tidygapminder'

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

Help Index


Tidy Gapminder indicator data sheets stored in a folder.

Description

Applies tidy_index to all Gapminder data sheets found in a directory and optionally combines them into a single data frame.

Usage

tidy_bunch(dirpath = ".", combine = FALSE, ...)

Arguments

dirpath

Path to folder containing indices Gapminder indicator data sheets. Defaults to the current working directory.

combine

A boolean. If TRUE, combines all tidied data sheets into a single data frame joined on country and year. Default: FALSE.

...

Additional arguments (reserved for future use).

Value

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.

Examples

folder_path <- system.file("extdata", package = "tidygapminder")

tidy_bunch(folder_path)
tidy_bunch(folder_path, combine = TRUE)

Tidy a Gapminder indicator data sheet.

Description

Tidy a Gapminder indicator data sheet.

Usage

tidy_index(filepath)

tidy_indice(filepath)

Arguments

filepath

Path to a Gapminder indicator data sheet (.csv, .xlsx, or .xls).

Value

The indicator data sheet as a tidy data frame with columns country, year, and the indicator name.

Examples

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)