View source: R/derive_extreme_event.R
| derive_extreme_event | R Documentation |
Add the first available record from events for each by group as new
records, all variables of the selected observation are kept. It can be used
for selecting the extreme observation from a series of user-defined events.
This distinguishes derive_extreme_event() from derive_extreme_records(),
where extreme records are derived based on certain order of existing
variables.
derive_extreme_event(
dataset = NULL,
by_vars,
events,
tmp_event_nr_var = NULL,
order,
mode,
source_datasets = NULL,
check_type = "warning",
set_values_to = NULL,
keep_source_vars = exprs(everything())
)
dataset |
Input dataset The variables specified by the |
by_vars |
Grouping variables |
events |
Conditions and new values defining events A list of For |
tmp_event_nr_var |
Temporary event number variable The specified variable is added to all source datasets and is set to the number of the event before selecting the records of the event. It can be used in The variable is not included in the output dataset. |
order |
Sort order If a particular event from For handling of |
mode |
Selection mode (first or last) If a particular event from |
source_datasets |
Source datasets A named list of datasets is expected. The |
check_type |
Check uniqueness? If |
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(
PARAMCD = "WOBS",
PARAM = "Worst Observations"
)
|
keep_source_vars |
Variables to keep from the source dataset For each event the specified variables are kept from the selected
observations. The variables specified for |
For each event select the observations to consider:
If the event is of class event, the observations of the source dataset
are restricted by condition and then the first or last (mode)
observation per by group (by_vars) is selected.
If the event is of class event_joined, filter_joined() is called to
select the observations.
The variables specified by the set_values_to field of the event
are added to the selected observations.
The variable specified for tmp_event_nr_var is added and set to
the number of the event.
Only the variables specified for the keep_source_vars field of the
event, and the by variables (by_vars) and the variables created by
set_values_to are kept. If keep_source_vars = NULL is used for an event
in derive_extreme_event() the value of the keep_source_vars argument of
derive_extreme_event() is used.
All selected observations are bound together.
For each group (with respect to the variables specified for the
by_vars parameter) the first or last observation (with respect to the
order specified for the order parameter and the mode specified for the
mode parameter) is selected.
The variables specified by the set_values_to parameter are added to
the selected observations.
The observations are added to input dataset.
Note: This function creates temporary datasets which may be much bigger
than the input datasets. If this causes memory issues, please try setting
the admiral option save_memory to TRUE (see set_admiral_options()).
This reduces the memory consumption but increases the run-time.
The input dataset with the best or worst observation of each by group added as new observations.
event(), event_joined(), derive_vars_extreme_event()
BDS-Findings Functions for adding Parameters/Records:
default_qtc_paramcd(),
derive_expected_records(),
derive_extreme_records(),
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.