derive_vars_merged_vaccine {admiralvaccine} | R Documentation |
Add New Variable(s) to the Input dataset Based on Variables from Another dataset
Description
Add new variables to the input dataset based on variables from another dataset.
The variables to be added to the output dataset will be based on input variables
passed on ex_vars
argument.
Usage
derive_vars_merged_vaccine(
dataset,
dataset_ex,
by_vars_sys,
by_vars_adms,
dataset_supp = NULL,
dataset_suppex = NULL,
ex_vars
)
Arguments
dataset |
Input dataset The variables specified by the |
dataset_ex |
EX dataset to merge with the input dataset. The variables specified by the |
by_vars_sys |
Grouping variables for systemic events. |
by_vars_adms |
Grouping variables for administration site events. |
dataset_supp |
Supplementary input dataset By default |
dataset_suppex |
Supplementary EX dataset By default |
ex_vars |
Variables to be added to the output dataset from EX dataset |
Details
The input dataset will be merged with EX
dataset for "ADMINISTRATION SITE" and
"SYSTEMIC" categories separately and these datasets will be bound together as
the final output dataset.
This function is intended to add only EX
variables to the input dataset and user
is expected to handle if any pre-processing is required.
Only the variables passed to the ex_vars
will be added in the output dataset
If the input dataset has multiple vaccination for a subject at same visit then this function will not merge ex dataset and will return only the input dataset merged with its supplementary dataset.
Value
The dataset with variables added from the EX dataset.
Author(s)
Vikram S
See Also
Other der_var:
derive_var_aval_adis()
,
derive_vars_crit()
,
derive_vars_event_flag()
,
derive_vars_max_flag()
,
derive_vars_params()
,
derive_vars_vaxdt()
Examples
library(tibble)
library(admiral)
library(dplyr)
library(pharmaversesdtm)
derive_vars_merged_vaccine(
dataset = face_vaccine,
dataset_ex = ex_vaccine,
dataset_supp = NULL,
dataset_suppex = NULL,
by_vars_sys = exprs(USUBJID, FATPTREF = EXLNKGRP),
by_vars_adms = exprs(USUBJID, FATPTREF = EXLNKGRP, FALOC = EXLOC, FALAT = EXLAT),
ex_vars = exprs(EXTRT, EXDOSE, EXDOSU, EXSTDTC, EXENDTC)
) %>%
select(USUBJID, FATPTREF, FALOC, FALAT, EXTRT, EXDOSE, EXDOSU, EXSTDTC, EXENDTC) %>%
head(10)
derive_vars_merged_vaccine(
dataset = face_vaccine,
dataset_ex = ex_vaccine,
dataset_supp = suppface_vaccine,
dataset_suppex = suppex_vaccine,
by_vars_sys = exprs(USUBJID, FATPTREF = EXLNKGRP),
by_vars_adms = exprs(USUBJID, FATPTREF = EXLNKGRP, FALOC = EXLOC, FALAT = EXLAT),
ex_vars = exprs(EXTRT, EXDOSE, EXDOSU, EXSTDTC, EXENDTC)
) %>%
filter(CLTYP == "DAIRY") %>%
select(USUBJID, FATPTREF, CLTYP, EXTRT, EXDOSE, EXDOSU, EXSTDTC, EXENDTC)