View source: R/derive_extreme_records.R
| derive_extreme_records | R Documentation |
Add the first or last observation for each by group as new observations. The
new observations can be selected from the additional dataset. This function can
be used for adding the maximum or minimum value as a separate visit.
All variables of the selected observation are kept. This distinguishes
derive_extreme_records() from derive_summary_records(),
where only the by variables are populated for the new records.
derive_extreme_records(
dataset = NULL,
dataset_add,
dataset_ref = NULL,
by_vars = NULL,
order = NULL,
mode = NULL,
filter_add = NULL,
check_type = "warning",
exist_flag = NULL,
true_value = "Y",
false_value = NA_character_,
keep_source_vars = exprs(everything()),
set_values_to
)
dataset |
Input dataset If the argument is not specified (or set to |
dataset_add |
Additional dataset The additional dataset, which determines the by groups returned in the input dataset,
based on the groups that exist in this dataset after being subset by The variables specified in the |
dataset_ref |
Reference dataset The variables specified for For records which are added from |
by_vars |
Grouping variables If |
order |
Sort order Within each by group the observations are ordered by the specified order. |
mode |
Selection mode (first or last) If |
filter_add |
Filter for additional dataset ( Only observations in |
check_type |
Check uniqueness? If |
exist_flag |
Existence flag The specified variable is added to the output dataset. For by groups with at least one observation in the additional dataset
( For all other by groups |
true_value |
True value For new observations selected from the additional dataset ( |
false_value |
False value For new observations not selected from the additional dataset
( |
keep_source_vars |
Variables to be kept in the new records A named list or tidyselect expressions created by |
set_values_to |
Variables to be set The specified variables are set to the specified values for the new observations. Set a list of variables to some specified value for the new records
For example: set_values_to = exprs(
AVAL = sum(AVAL),
DTYPE = "AVERAGE",
)
|
The additional dataset (dataset_add) is restricted as specified by the
filter_add argument.
For each group (with respect to the variables specified for the
by_vars argument) the first or last observation (with respect to the
order specified for the order argument and the mode specified for the
mode argument) is selected.
If dataset_ref is specified, observations which are in dataset_ref
but not in the selected records are added. Variables that are common
across dataset_ref, dataset_add and keep_source_vars() are also
populated for the new observations.
The variables specified by the set_values_to argument are added to
the selected observations.
The variables specified by the keep_source_vars argument are selected
along with the variables specified in by_vars and set_values_to
arguments.
The observations are added to input dataset (dataset). If no input
dataset is provided, a new dataset is created.
The input dataset with the first or last observation of each by group added as new observations.
derive_summary_records()
BDS-Findings Functions for adding Parameters/Records:
default_qtc_paramcd(),
derive_expected_records(),
derive_extreme_event(),
derive_locf_records(),
derive_param_bmi(),
derive_param_bsa(),
derive_param_computed(),
derive_param_doseint(),
derive_param_exist_flag(),
derive_param_exposure(),
derive_param_framingham(),
derive_param_map(),
derive_param_qtc(),
derive_param_rr(),
derive_param_wbc_abs(),
derive_summary_records()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.