setData | R Documentation |
Sets data according to a list of arguments.
setData(dat, Args = setArgs(), time2 = NULL, age_cut = NULL, birthdate = NULL)
dat |
A dataset to subset. |
Args |
Takes a list of arguments from |
time2 |
The name of a date variable that is used to calculate the Age variable using the
|
age_cut |
Vector of ages to make age categories from |
birthdate |
Takes the dataset generated from |
data.frame
hiv <- getHIV()
Args <- setArgs(Age=list(All=c(15, 25)))
# This will use the existing Age variable to subset
adat <- setData(hiv, Args)
# This will create a new Age variable using the birthdat and subset by age
adat1 <- setData(hiv, Args, time2="VisitDate", birthdate=getBirthDate())
# Note that there will be some discrepancy in the number of observations between adat and
adat1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.