# NOT RUN {
# Load diamonds dataset from ggplot2
library(ggplot2)
data("diamonds", package = "ggplot2")
# Plot bar charts for diamonds dataset
plot_bar(diamonds)
plot_bar(diamonds, maxcat = 5)
# Plot bar charts with `price` feature
plot_bar(diamonds, with = "price")
# Plot bar charts with preset ggplot2 themes
plot_bar(diamonds, ggtheme = theme_light())
plot_bar(diamonds, ggtheme = theme_minimal(base_size = 20))
# Plot bar charts with customized theme components
plot_bar(diamonds,
theme_config = list(
"plot.background" = element_rect(fill = "yellow"),
"aspect.ratio" = 1
))
# }
Run the code above in your browser using DataLab