presc_top_drugs: Produce a List of the Most Commonly Prescribed Drugs

Description Usage Arguments Value Examples

View source: R/summaries.R

Description

Function produces a list of the most commonly prescribed drugs and the number of prescriptions for each, based on unique drug IDs. The number of results returned can be adjusted.

Usage

1
presc_top_drugs(df, drug = ".", rank = 10, drug_id_col = "drug_id")

Arguments

df

a data frame containing prescribing records to be analysed - records must contain at least a drug identifier

drug

a string containing a drug ID to be used to limit the prescribing data to the drug(s) of interest, accepts regular expressions

rank

the number of drugs to be included in the list

drug_id_col

a string, the name of the column in df containing the drug IDs

Value

a data frame containing a list of drug IDs and corresponding number of prescriptions

Examples

1
2
presc_top_drugs(synth_presc, drug_id_col = "approved_name")
presc_top_drugs(synth_presc, rank = 5, drug_id_col = "bnf_item_code")

amarshall1/prescribeR documentation built on May 20, 2020, 2:34 p.m.