MarkUse {public.ctn0094extra} | R Documentation |
Mark Use Day by Subject
Description
Mark Use Day by Subject
Usage
MarkUse(
targetDrugs_char,
drugs_df = NULL,
reportSource = c("TFB", "UDSAB", "UDS"),
retainEmptyRows = FALSE
)
Arguments
targetDrugs_char |
A character vector including which drugs should be counted against the subject |
drugs_df |
A data frame with columns |
reportSource |
A character vector matching the source of the reported
drug use. The options must be from Timeline Followback ( |
retainEmptyRows |
A logical flag to force rows for participants who did
not have UDS positive for the substances listed in |
Details
This function is basically just a fancy wrapper around some dplyr code. We just don't want the user to have to 1) know dplyr, or 2) write the code themselves.
Value
A modification of the drugs_df
data set: the columns are
"who"
, "when"
, and "source"
; each row corresponds
to one use day per subject per use source (if, for instance, there is drug
use for a particular day recorded in both TFB and UDS, then that day will
have two rows in the resulting data set).
Examples
MarkUse(c("Crack", "Pcp", "Opioid"))