View source: R/derive_vars_max_flag.R
max_flag | R Documentation |
To Flag the maximum records depends on the grouping variables in a flag variable.
max_flag(dataset, by_vars, fl)
dataset |
Input dataset |
by_vars |
By variables which goes to group by, to create the flag. Pass the variables inside the exprs(). |
fl |
Flag variable name, Pass it as string. |
Data frame with flag variable which is flagged for the maximum value records depending on
the variables passed in by_vars
by user.
Dhivya Kanagaraj
library(tibble)
library(admiral)
input <- tribble(
~USUBJID, ~FAOBJ, ~FATESTCD, ~FATPTREF, ~AVAL, ~FATPT, ~PARAMCD,
"ABC101", "REDNESS", "DIAMETER", "VACC 1", 10, "DAY 1", "DIARE",
"ABC101", "REDNESS", "DIAMETER", "VACC 1", 7, "DAY 2", "DIARE",
"ABC101", "REDNESS", "DIAMETER", "VACC 2", 3, "DAY 1", "DIARE",
"ABC101", "REDNESS", "DIAMETER", "VACC 2", 8, "DAY 2", "DIARE",
"ABC101", "FATIQUE", "SEV", "VACC 1", 1, "DAY 1", "SEVFAT",
"ABC101", "FATIQUE", "SEV", "VACC 1", 1, "DAY 2", "SEVFAT",
"ABC101", "FATIQUE", "SEV", "VACC 2", 2, "DAY 1", "SEVFAT",
"ABC101", "FATIQUE", "SEV", "VACC 2", 3, "DAY 2", "SEVFAT"
)
max_flag(
dataset = input,
by_vars = exprs(USUBJID, FAOBJ, FATPTREF, PARAMCD),
fl = "ANL01FL"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.