Function to create an adverse event dataset.
Usage
# S3 method for class 'adverse_events'
create_table(
data,
name_column = "item_name",
value_column = "item_value",
keep_vars = c("subject_id", "form_repeat"),
expected_columns = NULL,
worsening_start_column = "date of worsening",
SAE_start_column = "SAE Start date",
AE_start_column = "start date",
AE_end_column = "end date",
...
)
Arguments
- data
A data frame to convert, in long format.
- name_column
Character string. Column that contains all the names for the wide table format.
- value_column
Character string. Column that contains all the values of the table in wide format.
- keep_vars
all common variables that identify a unique single data row.
- expected_columns
A character vector with the names of the expected variables. Needed to make sure that all expected columns are always created, even if some variables are implicitly missing (which might occur if there are not yet any values available for a specific variable). Also, implicitly missing variables might give errors if part of the script relies on the variables' presence.
- worsening_start_column
Character vector. Name of the column containing the date at which worsening of the (S)AE started.
- SAE_start_column
Character vector. Name of the column containing the SAE start date.
- AE_start_column
Character vector. Name of the column containing the AE start date.
- AE_end_column
Character vector. Name of the column containing the AE end date.
- ...
Other options. Currently unused.