doughnut: Donut/Doughnut plot

doughnutR Documentation

Donut/Doughnut plot

Description

Generation of a donut/doughnut plot (equivalent of a pie chart)

Usage

doughnut(
  x,
  labels = as.character(x),
  edges = 200,
  outer.radius = 0.8,
  inner.radius = 0.4,
  clockwise = FALSE,
  init.angle = if (clockwise) 90 else 0,
  density = NULL,
  angle = 45,
  col = NULL,
  border = FALSE,
  lty = NULL,
  main = NULL,
  ...
)

Arguments

x

A vector containing the values to be plotted.

labels

A string vector for the labels of the different sectors. By default as.character(x).

edges

Number of edges of the shape. By default 200.

outer.radius

Fraction of the area to dedicate to the outer circle. By default 0.8.

inner.radius

Fraction of the area to dedicate to the inner circle. By default 0.4.

clockwise

Logic value to define whether the values should be plotted in clockwise sense. By default FALSE.

init.angle

Numeric value to define the starting angle for the data. By default if clockwise = TRUE 90, otherwise 0.

density

A vector or single number to define de density of the lines in the filling color of each value plotted. By default NULL.

angle

A vector or single number to define de angle of the lines in the filling color of each value plotted. By default 45.

col

A vector of R standard colors for each value to be plotted. By default NULL.

border

Logic value to define whether plot the border of the sectors. By default FALSE.

lty

Numeric value to define the type of line for the borders. By default NULL.

main

String to set the title of the plot. By default NULL.

Value

Prints the plot

References

https://magesblog.com/

Examples

doughnut(x = c(3,5,9,12), inner.radius=0.5, col=c("red", "blue", "green", "yellow"))


sebastian-gregoricchio/Rseb documentation built on May 15, 2024, 5:45 a.m.