pie_plot: pie_plot

pie_plotR Documentation

pie_plot

Description

Creates pie charts.

Usage

pie_plot(
  data,
  x,
  y = "1",
  facet_x = NULL,
  facet_y = NULL,
  labels_y = function(x) ez_labels(x * 100, append = "%", round = round, signif =
    signif),
  size = 11,
  label_cutoff = 0.04,
  round = Inf,
  signif = 3,
  palette = ez_col,
  reorder = c("x", "facet_x", "facet_y"),
  label_x = 0.8,
  legend_ncol = NULL
)

Arguments

data

A data.frame.

x

A named character value. Evaluates to a column.

y

A named character value. Evaluates to a column.

facet_x

A character value. Evaluates to a column.

facet_y

A character. Evaluates to a column.

labels_y

label formatting function

size

theme size for use_theme(). Default is 14.

label_cutoff

Cutoff size (proportion of y data range) for excluding labels

round

Option for rounding label.

signif

Option for retaining significant figures in label.

palette

Colour function.

reorder

A character vector specifying the group variables to reorder. Default is c("group", "facet_x", "facet_y").

label_x

Position of label from centre of pie. 0 is the centre of the pie and 1 is the outer edge.

legend_ncol

Number of columns in legend.

Value

ggplot object

Examples


suppressPackageStartupMessages(library(tsibble))
library(tsibbledata)
pie_plot(ansett, "Class", "Passengers")
pie_plot(ansett, "Class", "Passengers", reorder = NULL, label_x = 0.5)
pie_plot(ansett, "Class", "Passengers", "Airports", reorder = NULL, label_x = 0.5)


ezplot documentation built on Aug. 12, 2022, 1:07 a.m.