Learn R Programming

ggiraphExtra (version 0.1.0)

ggPieDonut: Draw a Pie and Donut plot

Description

Draw a Pie and Donut plot

Usage

ggPieDonut(data, mapping, addPieLabel = TRUE, addDonutLabel = TRUE,
  showRatioDonut = TRUE, showRatioPie = TRUE, showRatioPieAbove10 = TRUE,
  title = "", labelposition = 1, polar = TRUE, interactive = FALSE)

Arguments

data

A data.frame

mapping

Set of aesthetic mappings created by aes or aes_.

addPieLabel

A logical value. If TRUE, labels are added to the Pies

addDonutLabel

A logical value. If TRUE, labels are added to the Donuts

showRatioDonut

A logical value. If TRUE, Ratios are added to the DonutLabels

showRatioPie

A logical value. If TRUE, Ratios are added to the PieLabels

showRatioPieAbove10

A logical value. If TRUE, labels are added to the Pies with ratio above 10.

title

Plot title

labelposition

A number indicating the label position

polar

A logical value. If TRUE, coord_polar() function will be added

interactive

A logical value. If TRUE, an interactive plot will be returned

Value

An interactive Pie and Donut plot

Examples

Run this code
# NOT RUN {
require(ggplot2)
require(ggiraph)
require(plyr)
require(moonBook)
ggPieDonut(acs,aes(pies=Dx,donuts=smoking))
ggPieDonut(browsers,aes(pies=browser,donuts=version,count=share))
ggPieDonut(browsers,aes(x=c(browser,version),y=share),interactive=TRUE)
# }

Run the code above in your browser using DataLab