ggla_donut: ggla_donut

Description Usage Arguments Details Aesthetics See Also Examples

View source: R/ggla_donut.R

Description

This creates a donut chart, similar to a pie chart.

Usage

1
2
3
4
5
6
7
8
9
ggla_donut(
  mapping = NULL,
  data = NULL,
  stat = "count",
  title = NULL,
  gla_theme = "default",
  base_size = 14,
  ...
)

Arguments

mapping

Set of aesthetic mappings created by aes() or aes_(). If specified and inherit.aes = TRUE (the default), it is combined with the default mapping at the top level of the plot. You must supply mapping if there is no plot mapping.

data

The data to be displayed in this layer. There are three options:

If NULL, the default, the data is inherited from the plot data as specified in the call to ggplot().

A data.frame, or other object, will override the plot data. All objects will be fortified to produce a data frame. See fortify() for which variables will be created.

A function will be called with a single argument, the plot data. The return value must be a data.frame, and will be used as the layer data. A function can be created from a formula (e.g. ~ head(.x, 10)).

stat

The statistical transformation to use on the data for this layer, as a string. Should be either 'count', for the number of cases in each group, or 'identity' to represent values in the data. Default: 'count'

title

String title to be used for plot. Will appear in the middle of the donut, Default: NULL

gla_theme

Either "default" or "inverse", Default: 'default'

base_size

base font size, Default: 14

...

Other arguments to be passed on to geom_bar()

Details

This works by creating a stacked bar chart and converting to polar coordinates.

Aesthetics

ggla_donut() understands the following aesthetics (required aesthetics in bold).

See Also

geom_bar

Examples

1
2
3
4
5
6
## Not run: 
if(interactive()){
 #EXAMPLE1
 }

## End(Not run)

Greater-London-Authority/gglaplot documentation built on Dec. 28, 2021, 8:27 p.m.