lp_bar_chart | R Documentation |
A bar chart with percentages
lp_bar_chart( data, var, .pct_reorder = TRUE, .drop_levels = TRUE, .hjust = -0.2, .xlab = NULL, .ylab = NULL, .title = NULL, .bar_col = "#EE5C42" )
data |
The dataset |
var |
The variable to plot |
.pct_reorder |
Logical length 1. Reorder the bars based on value? |
.drop_levels |
Logical length 1. Drop unused levels in the factor when counting ? i.e. do not show '0' count |
.hjust |
Numeric length 1. The jhust for the value labels. |
.xlab |
The x-axis label. Defaults to the variable name |
.ylab |
The y-axis label. Defaults to the variable name |
.title |
Optional title |
.bar_col |
The colour of the bars |
A ggplot object
lp_bar_chart(iris, Species)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.