waffleChart: Draw a fast waffle chart

Description Usage Arguments Details Value Examples

View source: R/doEDA.R

Description

waffleChart() is the flatten version of pieChart(). It works the best when a pie chart is less straight forward to reveal distribution of a factor variable.

Usage

1
2
waffleChart(.tbl_df, .group, divisor = NULL, tiles = 100,
  title = NULL, size = 2, palette = "Set2", legend_pos = "right")

Arguments

.tbl_df

A data frame

.group

A factor variable

divisor

A non-zero positive number

tiles

the default number of 100 for the number of tiles displayed on plotting canvas if divisor = NULL

title

A string

size

A number.

palette

A character vector or a string

legend_pos

legend position

Details

A wrapper function inherits from waffle(). It spares the data wrangling process for percentage computation and assemble for a named vector. The wrapper function also internally deals with conflict between the number of factor levels and the number of colors supplied to palette via RColorBrewer.

Value

A ggplot object

Examples

1
waffleChart(invest, age, divisor = 100)

chuckleong21/doEDA documentation built on Nov. 4, 2019, 8:52 a.m.