add_pie | R Documentation |
Add pie or donut chart
add_pie(plot, width = 1, reverse = FALSE, ...)
add_donut(plot, width = 1, reverse = FALSE, ...)
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 |
A tidyplot
object.
# 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()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.