plot_bar_id: Bar plot for univariate analysis

Description Usage Arguments Details Value Author(s) Examples

Description

It counts a categorical variable and plots a publication ready ggplot2 barplot

Usage

1
2
3
4
5
plot_bar_id(df, x, y, order = FALSE, theme = "light", mode = "count",
  fill = FALSE, flip = FALSE, fillc = "darkgrey",
  base_font = "Fira Sans Condensed",
  title_font = "Fira Sans Condensed Medium", title = NULL,
  subtitle = NULL)

Arguments

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

Details

Uses dplyr and ggplot

Value

Um grafico de barras para a variavel x da base df.

Author(s)

Bruno Pinheiro

Examples

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)

bruno-pinheiro/seda documentation built on May 23, 2019, 1:59 a.m.