ggPieDonut: Draw a Pie and Donut plot

Description Usage Arguments Value Examples

View source: R/ggPieDonut.R

Description

Draw a Pie and Donut plot

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
ggPieDonut(
  data,
  mapping,
  addPieLabel = TRUE,
  addDonutLabel = TRUE,
  showRatioDonut = TRUE,
  showRatioPie = TRUE,
  showRatioPieAbove10 = TRUE,
  title = "",
  labelposition = 1,
  polar = TRUE,
  use.label = TRUE,
  use.labels = 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

use.label

Logical. Whether or not use column label in case of labelled data

use.labels

Logical. Whether or not use value labels in case of labelled data

interactive

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

Value

An interactive Pie and Donut plot

Examples

1
2
3
4
5
6
7
8
require(ggplot2)
require(ggiraph)
require(plyr)
require(moonBook)
ggPieDonut(acs,aes(pies=Dx,donuts=smoking))
ggPieDonut(acs,aes(pies=smoking))
ggPieDonut(browsers,aes(pies=browser,donuts=version,count=share))
ggPieDonut(browsers,aes(x=c(browser,version),y=share),interactive=TRUE)

Example output

Loading required package: ggplot2
Loading required package: ggiraph
Loading required package: plyr
Loading required package: moonBook

Attaching package: 'moonBook'

The following objects are masked from 'package:ggiraphExtra':

    addLabelDf, getMapping

Warning messages:
1: `axis.ticks.margin` is deprecated. Please set `margin` property  of `axis.text` instead 
2: `panel.margin` is deprecated. Please use `panel.spacing` property instead 
Warning messages:
1: `axis.ticks.margin` is deprecated. Please set `margin` property  of `axis.text` instead 
2: `panel.margin` is deprecated. Please use `panel.spacing` property instead 
Warning messages:
1: `axis.ticks.margin` is deprecated. Please set `margin` property  of `axis.text` instead 
2: `panel.margin` is deprecated. Please use `panel.spacing` property instead 
Warning messages:
1: `axis.ticks.margin` is deprecated. Please set `margin` property  of `axis.text` instead 
2: `panel.margin` is deprecated. Please use `panel.spacing` property instead 

ggiraphExtra documentation built on Oct. 23, 2020, 7:39 p.m.