View source: R/scores_su_sui_tlfb.R
check_args_tlfb | R Documentation |
Validates the arguments to compute a TLFB substance use score.
check_args_tlfb(
data,
name,
substance = NULL,
period = NULL,
days = NULL,
wknd = NULL,
co_use = NULL,
binge = NULL,
position = NULL
)
data |
tibble. A data frame containing the TLFB raw data. |
name |
character. The name of the output column for the computed score. |
substance |
character (vector). The substance(s) to compute the score for. Must be one or several of the following values:
(Default: |
period |
character (vector). The period for which the score is
computed for. Must be one of |
days |
integer. Number of days before the TLFB interview to consider.
(Default: |
wknd |
logical. Whether the score should be computed for weekends only
( |
co_use |
character (vector). Co-use substance(s). Must be one or several
of the possible values for |
binge |
(named list of) numeric. Binge threshold(s) for the
substance(s). If only one value is provided, it is used, independent of the
sex of the participant. If a list is provided, it must contain two named
elements: |
position |
character. The position of the substance use event. Must be
one of |
NULL
. Invisibly returns NULL
if all checks pass. Otherwise, an
error is raised.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.