| plot_pieplot | R Documentation |
Pie chart from a two‑column data.frame (category, value) using polar coordinates.
plot_pieplot(
data,
label_x = "",
label_y = "",
colors = NULL,
textcolor = "white",
bordercolor = "black"
)
data |
two‑column data.frame with category and value |
label_x |
x‑axis label (unused in pie, kept for symmetry) |
label_y |
y‑axis label (unused in pie) |
colors |
vector of slice fills |
textcolor |
label text color |
bordercolor |
slice border color |
Slices are sized by the second (numeric) column. Text and border colors can be customized.
returns a ggplot2::ggplot graphic
#summarizing iris dataset
data <- iris |> dplyr::group_by(Species) |>
dplyr::summarize(Sepal.Length=mean(Sepal.Length))
head(data)
#ploting data
grf <- plot_pieplot(data, colors=c("red", "green", "blue"))
plot(grf)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.