Description Usage Arguments Value Examples
Function produces a high-level summary of a data frame, either the number of prescriptions and date of the first and last prescription for each patient or the total number of prescriptions and patients, the median and IQR prescriptions per patient and the dates of the first and last prescriptions across the data
1 2 3 | presc_data_summary(df, drug = ".", summary = TRUE,
patient_id_col = "patient_id", drug_id_col = "drug_id",
presc_date_col = "presc_date_x", date_format)
|
df |
a data frame containing prescribing records to be analysed - records must contain at least a patient ID, a drug identifier and a prescription date |
drug |
a string containing a drug ID to be used to limit the prescribing data to the drug(s) of interest, accepts regular expressions |
summary |
logical, if FALSE returns data on individual patients, if TRUE returns summary values |
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 |
date_format |
a string, the format of the dates in |
a data frame containing either a per patient summary of the data or a
summary of the whole dataset, depending on the fvalue of summary
1 2 3 4 5 | presc_data_summary(synth_presc, summary = FALSE, drug_id_col = "approved_name",
presc_date_col = "presc_date", date_format = "%Y-%m-%d")
presc_data_summary(synth_presc, drug = "SIMVASTATIN", summary = TRUE,
drug_id_col = "approved_name",
presc_date_col = "presc_date", date_format = "%Y-%m-%d")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.