Description Usage Arguments Value Examples
View source: R/standardising.R
Adjusts the field names and data formats of prescribing and events data to create a data frame in a format suited for use with the other functions in this package - mostly called internally by the other functions in this package, but can be used directly by the user to reduce the number of arguments which need to be passed to other functions as these standardised values are inluded as the default values in their code.
1 2 3 4 |
df |
a data frame containing the data of interest |
patient_id_col |
a string, the name of the column in |
drug_id_col |
a string, the name of the column in |
presc_date_col |
a string, the name of the column in |
dd_disp_col |
a string, the name of the column in |
qty_disp_col |
a string, the name of the column in |
qty_per_day_col |
a string, the name of the column in |
ev_date_1_col |
a string, the name of the column containing the first event dates |
ev_date_2_col |
a string, the name of the column containing the second event dates if present |
date_format |
a string, the format of the dates in |
a data frame with standardised field names and formats
1 2 3 4 5 | tidy_synth <- tidy_presc(df = synth_presc, drug_id_col = "approved_name",
dd_disp_col = "ddd_dispensed", qty_disp_col = "qty_dispensed",
date_format = "%Y-%m-%d")
tidy_synth <- tidy_presc(synth_events, patient_id = "patient_id",
ev_date_1 = "start_date")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.