qplot_waffle: Waffle plot

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
2
qplot_waffle(x, shape = 15, rows = NULL, cols = NULL,
  drop_shadow_h = -0.3, drop_shadow_v = 0.3)

Arguments

x

a variable with not too many unique values

shape

defaults to a filled square

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

drop_shadow_h

horizontal offset of the drop shadow, tinker with this to get a proper shadow effect

drop_shadow_v

vertical offset of the drop shadow

Details

To avoid the Hermann grid illusion, don't use dark colours.

Examples

1
qplot_waffle(rep(1:2,each=200))

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