Description Usage Arguments Details Value Author(s) Examples
It counts a categorical variable and plots a publication ready ggplot2 barplot
1 2 3 4 5 |
df |
a data frame |
x |
a string indicating a categorical variable |
y |
a string indicating a numeric variable |
order |
TRUE/FALSE indicating if bars shoul be ordered (default is TRUE) |
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) |
title |
a string defining the plot title |
subtitle |
a string defining de subtitle of plot |
Uses dplyr and ggplot
Um grafico de barras para a variavel x
da base df
.
Bruno Pinheiro
1 2 3 4 5 6 7 | library(dplyr)
sample_data %>%
filter(!is.na(var5)) %>%
count(var5) %>%
plot_bar_id(x = "var5",
y = "n",
fill = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.