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()
.
sdtm_assign(
tgt_dat = NULL,
tgt_var,
raw_dat,
raw_var,
ct_spec = NULL,
ct_clst = NULL,
id_vars = oak_id_vars()
)
The returned data set depends on the value of tgt_dat
:
If no target dataset is supplied, meaning that tgt_dat
defaults to
NULL
, then the returned data set is raw_dat
, selected for the variables
indicated in id_vars
, and a new extra column: the derived variable, as
indicated in tgt_var
.
If the target dataset is provided, then it is merged with the raw data set
raw_dat
by the variables indicated in id_vars
, with a new column: the
derived variable, as indicated in tgt_var
.
Target dataset: a data frame to be merged against raw_dat
by
the variables indicated in id_vars
. This parameter is optional, see
section Value for how the output changes depending on this argument value.
The target SDTM variable: a single string indicating the name of variable to be derived.
The raw dataset (dataframe); must include the
variables passed in id_vars
and raw_var
.
The raw variable: a single string indicating the name of the
raw variable in raw_dat
.
Study controlled terminology specification: a dataframe with a
minimal set of columns, see ct_spec_vars()
for details. This parameter is
optional, if left as NULL
no controlled terminology recoding is applied.
A codelist code indicating which subset of the controlled
terminology to apply in the derivation. This parameter is optional, if left
as NULL
, all possible recodings in ct_spec
are attempted.
Key variables to be used in the join between the raw dataset
(raw_dat
) and the target data set (tgt_dat
).