Description Usage Arguments Details Value Author(s) Examples
It counts a categorical variable and plots a publication ready ggplot2 barplot
1 2 3 4 |
df |
a data frame |
x |
a string indicating a categorical variable |
title |
a string defining the plot title |
subtitle |
a string defining de subtitle of plot |
theme |
a string defining theme: "light" (default) or "dark" |
mode |
a string defining mode: "count" (default) or "prop" |
fill |
a string indicating a categorical variable |
flip |
a logical TRUE or FALSE |
fillc |
bar colors when fill == FALSE |
base_font |
a string indicating which font to use (default is Fira Sans Condensed) |
title_font |
a string indicating which font to use (default is Fira Sans Condensed Medium) |
Uses dplyr and ggplot
Um grafico de barras para a variavel x
da base df
.
Bruno Pinheiro
1 2 3 4 5 6 | # simple barplot
plot_bar(sample_data, "var5")
# plot more than one variable at once
vars <- c("var5", "year")
plots <- lapply(vars, function(i) plot_bar(sample_data, i))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.