qplot_waffle_tile: Waffle plot (tile)

Description Usage Arguments Details Examples

View source: R/feedback_plotting.R

Description

Pass in a a variable and get a waffle plot. Useful to display simple counts or if the variable has different values, a square pie chart. If the variable has a length that makes the individual squares hard to see, consider showing hundreds, thousands etc.

Usage

1
qplot_waffle_tile(x, rows = NULL, cols = NULL)

Arguments

x

a variable with not too many unique values

rows

defaults to the rounded up square root of the number of values

cols

defaults to the rounded down square root of the number of values

Details

This function allows and requires the least tinkering, but also does not drop shadows. To avoid the Hermann grid illusion, don't use dark colours.

adapted from http://shinyapps.stat.ubc.ca/r-graph-catalog/ who adapted it from http://www.techques.com/question/17-17842/How-to-make-waffle-charts-in-R who adapted it from http://ux.stackexchange.com/a/46543/56341

Examples

1
qplot_waffle_tile(rep(1:2,each=500))

grebbel/formr_test documentation built on May 17, 2019, 8:34 a.m.