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.
qplot_waffle_text(x, symbol = fontawesome_square, rows = NULL, cols = NULL, drop_shadow_h = -0.9, drop_shadow_v = 0.9, font_family = "FontAwesome", font_face = "Regular", font_size = round(140/sqrt(length(x))))
x | a variable with not too many unique values |
---|---|
symbol | pass a unicode symbol from FontAwesome here. Defaults to a square with rounded edges |
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 |
font_family | defaults to FontAwesome |
font_face | defaults to Regular |
font_size | defaults to round(140/sqrt(length(x))) |
This functions is like waffle_plot but it allows you to specify custom symbols from FontAwesome. Copypaste them from here: http://fontawesome.io/cheatsheet
To avoid the Hermann grid illusion, don't use dark colours.
# NOT RUN { qplot_waffle_text(rep(1:2,each=30), rows = 5) # }