add_pie {tidyplots} | R Documentation |
Add pie or donut chart
Description
Add pie or donut chart
Usage
add_pie(plot, width = 1, reverse = FALSE, ...)
add_donut(plot, width = 1, reverse = FALSE, ...)
Arguments
plot |
A |
width |
Width of the plot area. Defaults to |
reverse |
Whether the order should be reversed or not. Defaults to |
... |
Arguments passed on to the |
Value
A tidyplot
object.
Examples
# for a `count` only provide `color`
# `count` of the data points in each `energy_type` category
energy |>
tidyplot(color = energy_type) |>
add_pie()
energy |>
tidyplot(color = energy_type) |>
add_donut()
# for a `sum` provide `color` and `y`
# `sum` of `energy` in each `energy_type` category
energy |>
tidyplot(y = energy, color = energy_type) |>
add_pie()
energy |>
tidyplot(y = energy, color = energy_type) |>
add_donut()
[Package tidyplots version 0.2.2 Index]