Learn R Programming

DALY (version 1.5.0)

plot.DALY: Plot method for class 'DALY'

Description

Plot a stacked barplot of YLLs/YLDs with a DALY error bar.

Usage

"plot"(x, prob = 0.95, sort = TRUE, names = NULL, bars = TRUE, col = c("grey90", "white"), error_bars = TRUE, eb_col = "black", grid = TRUE, ...)

Arguments

x
Object of class 'DALY'
prob
Probability span by DALY error bar; defaults to 0.95
sort
Should values be sorted from high to low? defaults to TRUE
names
Vector of names to be plotted on the y-axis. If this argument is NULL, the default, then the names are taken from the name elements of the outcomes
bars
Should YLL/YLD bars be plotted? defaults to TRUE
col
Color of YLL and YLD barplot; defaults to c("grey90", "white")
error_bars
Should DALY error bars be plotted? defaults to TRUE
eb_col
Color of DALY error bars; defaults to black
grid
Should a vertical grid be plotted? defaults to TRUE
...
Additional arguments to be passed to barplot

Details

This function plots the results of the DALY calculation aggregated by outcome. By default, both a stacked barplot of YLLs/YLDs and an error bar of total DALYs are shown.

See Also

hist.DALY

DALYcalculator (for a brief description of the DALY Calculator) DALYmanual (for a more comprehensive overview)

Examples

Run this code
## Not run: 
# 
# ##= load toxoplasmosis example ============================
# setDALYexample(2)
# 
# ##= perform DALY calculation, store results in 'x'  =======
# x <- getDALY()
# 
# ##= plot results ==========================================
# par(mar = c(4, 7, 4, 1))
# plot(x)
# 
# plot(x, bars = FALSE)        # only error bars
# plot(x, error_bars = FALSE)  # only barplots
# ## End(Not run)

Run the code above in your browser using DataLab