plot.waffle.bf: Plot a waffle chart with dividing lines and labels This...

View source: R/plot.waffle.bf.R

plot.waffle.bfR Documentation

Plot a waffle chart with dividing lines and labels This function requires you to know the distribution of the squares already. In the future there will be a wrapper that helps you with determining the proportions

Description

Plot a waffle chart with dividing lines and labels This function requires you to know the distribution of the squares already. In the future there will be a wrapper that helps you with determining the proportions

Usage

## S3 method for class 'waffle.bf'
plot(named.vector, row.num = 5, colours = NULL,
  plot.title = "", plot.fig.num = "", plot.cat.title = "", caption = "",
  x.axis = "", dividing.line = FALSE, labels = FALSE, label.unit = "",
  export = FALSE, export.name = "Rplot")

Arguments

named.vector

A named vector that is of the form c("label"=num.square)

row.num

Number of rows to put in a waffle chart

colours

Vector (or set.colour function) of colours to use. If not, default palette is generated.

plot.title

Character denoting title of the plot

plot.fig.num

Character denoting plot number (or another plot annotations)

plot.cat.title

Legend title for the colour of the plot

caption

String that sets the caption: Sources, notes stc

x.axis

Notes to be placed - Recommended place to put what each square means if not clear already

dividing.line

TRUE/FALSE on whether we want to display the dividing lines between the groups

labels

TRUE/FALSE on whether we want to have labels on them or not

label.unit

character string that can add labels to it. Examples include "%"

export

TRUE/FALSE whether to export file as EPS under default options (height=scaled according to row number and cell number, width=12 inches)

export.name

Name of the exported EPS file

Value

ggplot2 object with all the right formatting

Examples

plot.waffle.bf(c("Red"=20,"Blue"=30,"Green"=50),label.unit="%")

BrookfieldIIE/BFTheme documentation built on March 24, 2023, 12:42 p.m.