derive_var_merged_cat {admiral} | R Documentation |
This function is deprecated, please use derive_vars_merged()
instead.
Merge a categorization variable from a dataset to the input dataset. The observations to merge can be selected by a condition and/or selecting the first or last observation for each by group.
derive_var_merged_cat(
dataset,
dataset_add,
by_vars,
order = NULL,
new_var,
source_var,
cat_fun,
filter_add = NULL,
mode = NULL,
missing_value = NA_character_
)
dataset |
Input dataset The variables specified by the |
dataset_add |
Additional dataset The variables specified by the |
by_vars |
Grouping variables The input dataset and the selected observations from the additional dataset
are merged by the specified by variables. The by variables must be a unique
key of the selected observations. Variables from the additional dataset can
be renamed by naming the element, i.e., Permitted Values: list of variables created by |
order |
Sort order If the argument is set to a non-null value, for each by group the first or last observation from the additional dataset is selected with respect to the specified order. Variables defined by the Permitted Values: list of expressions created by |
new_var |
New variable The specified variable is added to the additional dataset and set to the
categorized values, i.e., |
source_var |
Source variable |
cat_fun |
Categorization function A function must be specified for this argument which expects the values of the source variable as input and returns the categorized values. |
filter_add |
Filter for additional dataset ( Only observations fulfilling the specified condition are taken into account for merging. If the argument is not specified, all observations are considered. Variables defined by the Permitted Values: a condition |
mode |
Selection mode Determines if the first or last observation is selected. If the If the Permitted Values: |
missing_value |
Values used for missing information The new variable is set to the specified value for all by groups without observations in the additional dataset. Default: |
The additional dataset is restricted to the observations matching the
filter_add
condition.
The categorization variable is added to the additional dataset.
If order
is specified, for each by group the first or last observation
(depending on mode
) is selected.
The categorization variable is merged to the input dataset.
The output dataset contains all observations and variables of the
input dataset and additionally the variable specified for new_var
derived
from the additional dataset (dataset_add
).
Other deprecated:
derive_param_extreme_event()
,
derive_var_basetype()
,
derive_var_confirmation_flag()
,
derive_var_last_dose_amt()
,
derive_var_last_dose_date()
,
derive_var_last_dose_grp()
,
derive_var_merged_character()
,
derive_vars_last_dose()