View source: R/derive_vars_vaxdt.R
derive_vars_vaxdt | R Documentation |
Creates vaccination date variables from EX
domain. A date variable will be
created for each vaccination taking values from the variable EXSTDTC
.
derive_vars_vaxdt(dataset, dataset_adsl, by_vars, order)
dataset |
Input dataset The variables specified by the |
dataset_adsl |
Input adsl dataset The vaccination date variables created will be merged with this adsl dataset. |
by_vars |
Grouping variables. The variables to be grouped to filter the first observation within each by group. |
order |
Sorting variables. The variables order to be specified either in ascending or descending order. By default ascending order will be applicable. |
If there are multiple vaccinations for a visit per subject,warning will be
provided and only first observation will be filtered based on the variable
order specified on the order
argument. In this case, user need to select
the by_vars
appropriately.
The number of variables created will be based on the number of vaccinations per subject per visit.
The adsl dataset with vaccination date variables added to it.
Vikram S
Other der_var:
derive_var_aval_adis()
,
derive_vars_crit()
,
derive_vars_event_flag()
,
derive_vars_max_flag()
,
derive_vars_merged_vaccine()
,
derive_vars_params()
library(tibble)
library(admiral)
library(dplyr)
input <- tribble(
~USUBJID, ~EXSTDTC, ~VISITNUM, ~EXTRT, ~EXLNKGRP, ~VISIT,
"A001", "2015-01-10", 1, "DRUG A", "VAC 1", "VISIT 1",
"A001", "2015-01-11", 2, "DRUG A", "VAC 2", "VISIT 2",
"A001", "2015-01-12", 3, "DRUG B", "VAC 3", "VISIT 3",
"A002", "2015-01-13", 1, "DRUG B", "VAC 1", "VISIT 1",
"A002", "2015-01-14", 2, "DRUG C", "VAC 2", "VISIT 2"
)
adsl <- tribble(
~USUBJID, ~SEX, ~AGE,
"A001", "MALE", 23,
"A002", "FEMALE", 26,
)
derive_vars_vaxdt(
dataset = input,
dataset_adsl = adsl,
by_vars = exprs(USUBJID, VISITNUM),
order = exprs(USUBJID, VISITNUM, VISIT, EXSTDTC)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.