Learn R Programming

DALY (version 1.5.0)

DALY_list: Make list of ‘DALY’ objects

Description

This function produces a list of DALY objects and assigns class 'DALY_list' to it. Methods are available to print and plot the resulting object.

Usage

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

Arguments

...
In DALY_list: Multiple objects of class 'DALY'; In print.DALY_list: Additional arguments to be passed to print.DALY; In plot.DALY_list: Additional arguments to be passed to plot.DALY
x
Object of class 'DALY_list'
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 element of the constituting DALY objects
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

Value

An object of S3 class 'DALY_list'.

See Also

getDALY print.DALY plot.DALY scatterplot

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

Examples

Run this code
## Not run: 
# 
# ##= load NCC example ======================================
# setDALYexample(1)
# 
# ##= calculate DALYs under different scenarios =============
# ncc_00 <- getDALY(aw = FALSE, dr = 0)
# ncc_03 <- getDALY(aw = FALSE, dr = 0.03)
# ncc_13 <- getDALY(aw = TRUE,  dr = 0.03)
# 
# ##= store results as 'DALY_list' ==========================
# ncc <- DALY_list(ncc_00, ncc_03, ncc_13)
# 
# ##= barplot of different scenarios ========================
# par(mar = c(4, 4, 1, 1) + .5)
# plot(ncc, names = c("DALY[0,0]", "DALY[0,0.03]", "DALY[1,0.03]"))
# ## End(Not run)

Run the code above in your browser using DataLab