View source: R/percentage_bar.R
percentage_bar | R Documentation |
This function creates a percentage bar chart using ggplot2, where the user can specify the percentage to be represented as a bar along with an optional label.
percentage_bar(perc, label)
perc |
The percentage value to be represented as a bar in the chart. |
label |
An optional label to be displayed along with the percentage bar. |
A ggplot2 bar chart representing the given percentage value.
# Create a percentage bar chart with 30% labeled as "Completed"
percentage_bar(30, "Completed")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.