doughnut | R Documentation |
Generation of a donut/doughnut plot (equivalent of a pie chart)
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,
...
)
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 |
init.angle |
Numeric value to define the starting angle for the data. By default if |
density |
A vector or single number to define de density of the lines in the filling color of each value plotted. By default |
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 |
border |
Logic value to define whether plot the border of the sectors. By default |
lty |
Numeric value to define the type of line for the borders. By default |
main |
String to set the title of the plot. By default |
Prints the plot
doughnut(x = c(3,5,9,12), inner.radius=0.5, col=c("red", "blue", "green", "yellow"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.