knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
tidygapminder is designed to make easy to tidy data retrieved from Gapminder. Learn more in vignette("tidygapminder")
.
You can install the released version of tidygapminder from CRAN with:
install.packages("tidygapminder")
And the development version from GitHub with:
# install.packages("devtools") devtools::install_github("ebedthan/tidygapminder")
This is a basic example which shows you how to solve a common problem:
library(tidygapminder) # From ---------------------------------- df <- readxl::read_xlsx(system.file("extdata", "agriculture_land.xlsx", package = "tidygapminder")) df # To ------------------------------------ file <- system.file("extdata", "agriculture_land.xlsx", package = "tidygapminder") tidy_indice(file)
Or more powerful:
# From ---------------------------------------- path <- system.file("extdata", package = "tidygapminder") list.files(path) df df_ <- data.table::fread(system.file("extdata", "life_expectancy_years.csv", package = "tidygapminder")) df_ # To ------------------------------------------ tidy_bunch(dirpath = path, merge = TRUE)
Enjoy r emo::ji("smile")
!!!
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.