plot.disease_expose: Plot a 'disease_expose' Object

View source: R/plot.disease_expose.R

plot.disease_exposeR Documentation

Plot a disease_expose Object


Create grouped bar charts for each disease-exposure combination on one page


## S3 method for class 'disease_expose'
plot(x, ...)



an object of class disease_expose, created with disease_expose


additional arguments to be passed to geom_bar, such as position


A gtable object of grouped bar charts on one page


de_data <- disease_expose_data # use the example data in the package

cleaned_de_data <- clean_disease_expose(data = de_data, disease = "disease", noDisease = "No", exposures = c("exposure1", "exposure2", "exposure3")) # clean the data using specific columns in the dataset

## Not run: 
de_object <- disease_expose(cleaned_de_data) # the best way to create a disease_expose object is by using the helper and selecting your choices in the Shiny gadget

## End(Not run)

de_object <- new_disease_expose(cleaned_de_data, disease = 1, exposures = 2:8) # another way to create a disease_expose object is to use the constructor and manually enter the information

plot(x = de_object) # plot your disease_expose object

plot(x = de_object, position = 'dodge') # provide an input to geom_bar using the ... argument to customize the plot a little more

npeters1322/hospEpi documentation built on April 30, 2022, 6:12 p.m.