powered by
Axis-x has the frequency and data label has the percent value.
bar_chart( data, variable, axis_title = "", fill = "blue", axis_title_axis_size = 22, axis_text_axis_size = 22, data_label_size = 15, sort = TRUE )
a ggplot2 object
a dataframe object
variable name
axis y label. Defaults to "".
bar color. Character scale with hexidecimal color ou named color. Defaults to "blue".
integer scalar. Size of axis labels. Defaults to 22.
integer scalar. Size of values annotated in axis. Defaults to 22.
integer scalar. Size of data labels. Defaults to 15
logical scalar. If TRUE, the are ordered using frequency. Defaults to TRUE.
df <- data.frame(var = sample(c("A", "B"), size = 100, replace = TRUE)) bar_chart(df, var)
Run the code above in your browser using DataLab