The function uses ggplot2 to create waffle charts from data.
waffle_chart( data, fill, value = "value", facet = NULL, composition = TRUE, max_value = NULL, digits = 3, fill_colors = NULL, fill_title = NULL, ncol = NULL, base_size = 12, line_size = LS(1), legend.position = "bottom" )
data | data frame to be plotted |
---|---|
fill | character specifying the column name which should be used as fill for the waffle plot. |
value | character specifying the column name which contains values of the |
facet | character specifying the column name which should be used to |
composition | logical indicating whether a compositional waffle (i.e. fill adds up to 100%) should be created. If |
max_value | numerical giving the value to which waffle cells should be scaled to, if |
digits | integer indicating the number of decimal places to be used in rounding of the waffle cells. The value 3 indicates percentages, while 4 permilles. |
fill_colors | named character vector giving the colors for |
fill_title | character giving the title for the color legend. |
ncol | number of columns to be used in facetting. See |
base_size | numeric giving the base size for the plot. See |
line_size | numeric value giving the size of lines between waffles cells. |
legend.position | character specifying the position of the legend. See |
Returns a ggplot2 waffle plot
The waffle charts are read from left to right (like text) and from bottom upwards (like water glass). The cells indicate 1% of the maximum value (100
Other waffle:
round_preserve_sum()
,
waffleize()