sdtm_assign {sdtm.oak} | R Documentation |
Derive an SDTM variable
Description
sdtm_assign()
is an internal function packing the same functionality as
assign_no_ct()
and assign_ct()
together but aimed at developers only.
As a user please use either assign_no_ct()
or assign_ct()
.
Usage
sdtm_assign(
tgt_dat = NULL,
tgt_var,
raw_dat,
raw_var,
ct_spec = NULL,
ct_clst = NULL,
id_vars = oak_id_vars()
)
Arguments
tgt_dat |
Target dataset: a data frame to be merged against |
tgt_var |
The target SDTM variable: a single string indicating the name of variable to be derived. |
raw_dat |
The raw dataset (dataframe); must include the
variables passed in |
raw_var |
The raw variable: a single string indicating the name of the
raw variable in |
ct_spec |
Study controlled terminology specification: a dataframe with a
minimal set of columns, see |
ct_clst |
A codelist code indicating which subset of the controlled
terminology to apply in the derivation. This parameter is optional, if left
as |
id_vars |
Key variables to be used in the join between the raw dataset
( |
Value
The returned data set depends on the value of tgt_dat
:
If no target dataset is supplied, meaning that
tgt_dat
defaults toNULL
, then the returned data set israw_dat
, selected for the variables indicated inid_vars
, and a new extra column: the derived variable, as indicated intgt_var
.If the target dataset is provided, then it is merged with the raw data set
raw_dat
by the variables indicated inid_vars
, with a new column: the derived variable, as indicated intgt_var
.