mybarplot2: mybarplot2

View source: R/ACutils_export.R

mybarplot2R Documentation

mybarplot2

Description

Useful function to produce barplot within for loops.

Usage

mybarplot2(mydata, myexposure = NULL, myoutcome)

Arguments

mydata

tibble the dataset

myexposure

string the name of the categorical variable that defines the different levels. If it is not NULL, different bar levels are produced.

myoutcome

string the name of the categorical variable whose counts must the shown in a barplot.

Value

One bar for each level of level of the outcome variable. If there is exposure, an additional bar for each level of the exposure is produced.

Examples

mybarplot2(mydata = data2, myexposure =  "treatment", myoutcome =  "race")

alessandrocolombi/ACutils documentation built on March 3, 2023, 4:06 a.m.