waffle_iron: Waffle Iron

View source: R/iron.R

waffle_ironR Documentation

Waffle Iron

Description

Pour your data into a waffle iron to get ready to cook a waffle chart.

Usage

waffle_iron(data, mapping, rows = 8, sample_size = 1, na.rm = T)

Arguments

data

A dataframe to feed into the waffle iron

mapping

A mapping as produce by aes_d, aes_d_ or a character vector of a column present in the dataset

rows

The number of rows in the waffle

sample_size

The proportion of rows to sample the dataset (between 0 and 1). Useful when the dataset is too large to plot correctly.

na.rm

A boolean flag to automatically remove NAs. Removing NAs will sometimes cause a missing notch in your waffle.

Details

Prepare raw data so it is fit to create a waffle visualisation. The type of data transformation that is required does not gel well with ggplot2 underlying mechanism. The way around this is to provide a function that does the preperation outside of ggplot.

Examples

waffle_iron(mpg, aes_d(group = class))

waffle_iron(mpg, aes_d(group = class), sample_size = 0.75)

liamgilbey/ggwaffle documentation built on Sept. 3, 2022, 4:53 p.m.