waffle_iron | R Documentation |
Pour your data into a waffle iron to get ready to cook a waffle chart.
waffle_iron(data, mapping, rows = 8, sample_size = 1, na.rm = T)
data |
A dataframe to feed into the waffle iron |
mapping |
A mapping as produce by |
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. |
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.
waffle_iron(mpg, aes_d(group = class)) waffle_iron(mpg, aes_d(group = class), sample_size = 0.75)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.