n_subject {metalite} | R Documentation |
Count number of unique subjects
Description
Count number of unique subjects
Usage
n_subject(
id,
group,
par = NULL,
na = "Missing",
use_na = c("ifany", "no", "always")
)
Arguments
id |
A character vector of subject identifier. |
group |
A factor vector of group name. |
par |
A character vector of parameter name. |
na |
A character string used to label missing values. Defaults to |
use_na |
A character value for whether to include |
Value
A data frame summarizing the number of unique subjects in different arms.
Examples
library(r2rtf)
r2rtf_adae$TRTA <- factor(r2rtf_adae$TRTA)
r2rtf_adae$SEX[1:5] <- NA
n_subject(r2rtf_adae$USUBJID, r2rtf_adae$TRTA)
n_subject(r2rtf_adae$USUBJID, r2rtf_adae$TRTA, r2rtf_adae$SEX)
n_subject(r2rtf_adae$USUBJID, r2rtf_adae$TRTA, r2rtf_adae$SEX, use_na = "always")
n_subject(r2rtf_adae$USUBJID, r2rtf_adae$TRTA, r2rtf_adae$SEX, na = "Null")
[Package metalite version 0.1.3 Index]