You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
The MedxR package provides a unified interface to access open drug regulatory data from the U.S. Food and Drug Administration (FDA) Open API and the Health Canada Drug Product Database API.
TheMedxR package provides a unified interface to access open drug regulatory data from theU.S. Food and Drug Administration (FDA) Open API and theHealth Canada Drug Product Database API. It allows users to retrieve real-time or historical information aboutdrug approvals,adverse events,product recalls, andpharmaceutical details, enabling transparent and reproducible analysis of regulatory information across North America.
In addition to API-access functions, the package includes a curated collection of open datasets related todrugs, pharmaceuticals, treatments, and clinical studies. These datasets encompass diverse topics such as,treatment dosages,pharmacological research,placebo effects,drug reactions,misuse of pain relievers, andvaccine effectiveness.
Installation
You can install theMedxR package from CRAN with the following R function:
install.packages("MedxR")
You can install theMedxR package from its GitHub repository using thedevtools package with the following R function:
devtools::install_github("lightbluetitan/medxr")
Usage
After installation, load the package and start exploring and using its functions and datasets.
library(MedxR)
MedxR Functions
Below is a list of the main functions included in the package:
get_fda_adverse_events(): Search Adverse Events by Drug Name in FDA Adverse Event Reporting System, e.g.,get_fda_adverse_events("aspirin").
get_fda_drug_labels(): Search Drug Labels by Drug Name in FDA Drug Labeling Database, e.g.,get_fda_drug_labels("aspirin").
get_fda_drugs_approved(): Search FDA-Approved Drugs by Drug Name, e.g.,get_fda_drugs_approved("lipitor").
get_fda_ndc_directory(): Search National Drug Code (NDC) Directory by Drug Name, e.g.,get_fda_ndc_directory("ibuprofen").
get_hc_active_ingredients(): Get Active Ingredients from Health Canada Drug Product Database.
get_hc_companies(): Get Companies from Health Canada Drug Product Database.
get_hc_din(): Get All DINs from Health Canada Drug Product Database.
get_hc_drug_by_din(): Get a Drug Product by DIN from Health Canada Drug Product Database, e.g.,get_hc_drug_by_din("00000213").
get_hc_drug_products(): Retrieve Drug Products from Health Canada Drug Product Database.
get_hc_forms(): Get Pharmaceutical Forms from Health Canada Drug Product Database.
get_hc_search_drug(): Search Drug Products by Brand Name in Health Canada Drug Product Database, e.g.,get_hc_search_drug("NEMBUTAL").
Dataset Suffixes
Each dataset inMedxR is labeled with asuffix to indicate its structure and type:
_df: A standard data frame.
_tbl_df: A tibble data frame object.
_list: A list object.
_matrix: A matrix object.
Datasets Included in MedxR
In addition to API access functions,MedxR offers a curated collection of open datasets focused on drugs, pharmaceuticals, treatments, and clinical studies. These datasets cover diverse topics such as treatment dosages, pharmacological studies, placebo effects, drug reactions, misuses of pain relievers, and vaccine effectiveness. Below are some featured examples:
aspirin_infarction_df: A data frame containing results from a meta-analysis on the use of aspirin to prevent death after myocardial infarction.
drug_prices_tbl_df: A tibble containing information on unit prices for various pharmaceutical products. Each record includes a description, currency, cost per unit, unit type, and a parent key identifier.
placebos_df: A data frame containing pain relief data from both analgesics and placebos.
Example Code:
# Load the packagelibrary(MedxR)# Get a Drug Product by DIN from Health Canada Drug Product Databaseget_hc_drug_by_din("00000213")# Search Drug Labels by Drug Name in FDA Drug Labeling Databaseget_fda_drug_labels("aspirin")# Load a datasetdata(aspirin_infarction_df)# Shows six rows of the datasethead(aspirin_infarction_df)# Display the structure of the datasetstr(aspirin_infarction_df)# Shows the whole datasetView(aspirin_infarction_df)
About
The MedxR package provides a unified interface to access open drug regulatory data from the U.S. Food and Drug Administration (FDA) Open API and the Health Canada Drug Product Database API.