Type: | Package |
Title: | Access Drug Regulatory Data via FDA and Health Canada APIs |
Version: | 0.1.0 |
Maintainer: | Renzo Caceres Rossi <arenzocaceresrossi@gmail.com> |
Description: | Provides functions to access drug regulatory data from public RESTful APIs including the 'FDA Open API' and the 'Health Canada Drug Product Database API', retrieving real-time or historical information on drug approvals, adverse events, recalls, and product details. Additionally, the package includes 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. The package supports reproducible research and teaching in pharmacology, medicine, and healthcare by integrating reliable international APIs and structured datasets from public, academic, and government sources. For more information on the APIs, see: 'FDA API' https://open.fda.gov/apis/ and 'Health Canada API' https://health-products.canada.ca/api/documentation/dpd-documentation-en.html. |
License: | GPL-3 |
Language: | en |
URL: | https://github.com/lightbluetitan/medxr, https://lightbluetitan.github.io/medxr/ |
BugReports: | https://github.com/lightbluetitan/medxr/issues |
Encoding: | UTF-8 |
LazyData: | true |
Depends: | R (≥ 4.1.0) |
Imports: | utils, httr, jsonlite, dplyr, memoise |
Suggests: | ggplot2, testthat (≥ 3.0.0), knitr, rmarkdown |
RoxygenNote: | 7.3.2 |
Config/testthat/edition: | 3 |
VignetteBuilder: | knitr |
NeedsCompilation: | no |
Packaged: | 2025-10-11 23:23:55 UTC; Renzo |
Author: | Renzo Caceres Rossi
|
Repository: | CRAN |
Date/Publication: | 2025-10-16 18:30:13 UTC |
MedxR: Access Drug Regulatory Data via FDA and Health Canada APIs
Description
This package provides functions to access drug regulatory data from public RESTful APIs including the FDA Open API and the Health Canada Drug Product Database API, retrieving real-time or historical information on drug approvals, adverse events, recalls, and product details. Additionally, the package includes a curated collection of open datasets focused on drugs, pharmaceuticals, treatments, and clinical studies.
Details
MedxR: Access Drug Regulatory Data via FDA and Health Canada APIs
Access Drug Regulatory Data via FDA and Health Canada APIs.
Author(s)
Maintainer: Renzo Caceres Rossi arenzocaceresrossi@gmail.com
See Also
Useful links:
Drug Related ATC Codes
Description
This dataset, ATC_code_tbl_df, is a tibble containing ATC (Anatomical Therapeutic Chemical) classification codes assigned to drugs by the World Health Organization. The classification system categorizes drugs into different levels of anatomical and chemical structure.
Usage
data(ATC_code_tbl_df)
Format
A tibble with 50 observations and 10 variables:
- atc_code
Character variable representing the ATC code assigned to the drug
- level_1
Character variable indicating the anatomical main group
- code_1
Character variable indicating the code of level 1
- level_2
Character variable indicating the therapeutic subgroup
- code_2
Character variable indicating the code of level 2
- level_3
Character variable indicating the pharmacological subgroup
- code_3
Character variable indicating the code of level 3
- level_4
Character variable indicating the chemical subgroup
- code_4
Character variable indicating the code of level 4
- drugbank-id
Character variable with the corresponding DrugBank identifier
Details
The dataset name has been kept as 'ATC_code_tbl_df' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the MedxR package and assists users in identifying its specific characteristics. The suffix 'tbl_df' indicates that the dataset is a tibble. The original content has not been modified in any way.
Source
Data taken from the package covid19dbcand version 0.1.1
BCG Vaccine Effectiveness Studies
Description
This dataset, BCG_vaccine_df, is a data frame containing results from 13 studies evaluating the effectiveness of the Bacillus Calmette-Guerin (BCG) vaccine against tuberculosis. The dataset includes trial metadata and outcome counts for treatment and control groups.
Usage
data(BCG_vaccine_df)
Format
A data frame with 13 observations and 9 variables:
- trial
Integer variable identifying each trial
- author
Character variable with the name of the study author
- year
Integer variable indicating the publication year of the study
- tpos
Integer variable indicating the number of TB-positive cases in the treatment group
- tneg
Integer variable indicating the number of TB-negative cases in the treatment group
- cpos
Integer variable indicating the number of TB-positive cases in the control group
- cneg
Integer variable indicating the number of TB-negative cases in the control group
- ablat
Integer variable indicating the absolute latitude of the study location
- alloc
Character variable indicating the allocation type
Details
The dataset name has been kept as 'BCG_vaccine_df' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the MedxR package and assists users in identifying its specific characteristics. The suffix 'df' indicates that the dataset is a data frame. The original content has not been modified in any way.
Source
Data taken from the package metadat version 1.4-0
Aspirin after Myocardial Infarction
Description
This dataset, aspirin_infarction_df, is a data frame containing results from a meta-analysis on the use of aspirin to prevent death after myocardial infarction. It includes binary outcome data comparing aspirin and placebo groups.
Usage
data(aspirin_infarction_df)
Format
A data frame with 7 observations and 6 variables:
- study
Character variable identifying each study
- year
Integer variable indicating the publication year
- d.asp
Integer variable for the number of deaths in the aspirin group
- n.asp
Integer variable for the total number of patients in the aspirin group
- d.plac
Integer variable for the number of deaths in the placebo group
- n.plac
Integer variable for the total number of patients in the placebo group
Details
The dataset name has been kept as 'aspirin_infarction_df' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the MedxR package and assists users in identifying its specific characteristics. The suffix 'df' indicates that the dataset is a data frame. The original content has not been modified in any way.
Source
Data taken from the package meta version 8.2-1
Antibiotic Binding in Cows
Description
This dataset, binding_df, is a data frame containing the binding rate of antibiotics to serum protein in cows. The study measured the extent to which antibiotics bind to protein in the bloodstream, which can reduce the medical effectiveness of the drug. Twelve cows were given one of three antibiotics: chloramphenicol, erythromycin, or tetracycline.
Usage
data(binding_df)
Format
A data frame with 12 observations and 2 variables:
- antibiotic
Factor variable indicating the type of antibiotic administered
- binding
Numeric variable representing the measured binding rate to serum protein
Details
The dataset name has been kept as 'binding_df' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the MedxR package and assists users in identifying its specific characteristics. The suffix 'df' indicates that the dataset is a data frame. The original content has not been modified in any way.
Source
Data taken from the isdals package version 3.0.1
The Effects of Caffeine
Description
This dataset, caffeine_matrix, is a matrix containing data from Henson et al. [1996] investigating caffeine's effect on short-term visual memory. High school students (9 eighth-graders, 10 tenth-graders, 9 twelfth-graders) were tested twice: once after drinking caffeinated Coke and once after decaffeinated Coke. Students had 10 seconds to memorize 20 common objects, then 1 minute to recall them. The study examined whether students remembered more objects with decaffeinated versus caffeinated Coke.
Usage
data(caffeine_matrix)
Format
A numeric matrix with 28 rows and 3 columns:
- Grade
Numeric values indicating the grade level of the student (8, 10, or 12)
- Without
Number of objects remembered after drinking decaffeinated Coke
- With
Number of objects remembered after drinking caffeinated Coke
Details
The dataset name has been kept as 'caffeine_matrix' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the MedxR package and assists users in identifying its specific characteristics. The suffix 'matrix' indicates that the dataset is stored as a matrix object. The original content has not been modified in any way.
Source
Data taken from the msos package version 1.2.0
Pharmacologic Treatments for COPD
Description
This dataset, copd_drug_therapy_df, is a data frame containing results from 39 trials examining pharmacologic treatments for chronic obstructive pulmonary disease (COPD). It includes study identifiers, treatment groups, number of exacerbations, and sample sizes.
Usage
data(copd_drug_therapy_df)
Format
A data frame with 94 observations and 6 variables:
- study
Character variable identifying each study
- year
Integer variable indicating the publication year
- id
Integer variable representing the study ID
- treatment
Character variable describing the treatment group
- exac
Integer variable indicating the number of COPD exacerbations
- total
Integer variable for the total number of patients in the group
Details
The dataset name has been kept as 'copd_drug_therapy_df' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the MedxR package and assists users in identifying its specific characteristics. The suffix 'df' indicates that the dataset is a data frame. The original content has not been modified in any way.
Source
Data taken from the package metadat version 1.4-0
Treatment Dosages Defined by EUCAST
Description
This dataset, dosage_tbl_df, is a tibble containing treatment dosage information for antimicrobial agents as defined by EUCAST. The dosages are used to support interpretive breakpoints in antimicrobial susceptibility testing.
Usage
data(dosage_tbl_df)
Format
A tibble with 759 observations and 9 variables:
- ab
Antimicrobial ID
- name
Name of the antimicrobial agent
- type
Type of dosage scheme
- dose
Dose amount
- dose_times
Number of doses per day
- administration
Route of administration
- notes
Additional clinical notes
- original_txt
Original EUCAST dosage description
- eucast_version
EUCAST guideline version number
Details
The dataset name has been kept as 'dosage_tbl_df' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the MedxR package and assists users in identifying its specific characteristics. The suffix 'tbl_df' indicates that the dataset is a tibble. The original content has not been modified in any way.
Source
Data taken from the AMR package version 3.0.0
Unit Drug Prices
Description
This dataset, drug_prices_tbl_df, is 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.
Usage
data(drug_prices_tbl_df)
Format
A tibble with 208 observations and 5 variables:
- description
Character variable describing the drug or product
- currency
Character variable indicating the currency in which the price is expressed
- cost
Numeric variable indicating the unit cost of the drug
- unit
Character variable representing the measurement unit (e.g., tablet, mL)
- parent_key
Character variable serving as a linking identifier to related records
Details
The dataset name has been kept as 'drug_prices_tbl_df' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the MedxR package and assists users in identifying its specific characteristics. The suffix 'tbl_df' indicates that the dataset is a tibble data frame. The original content has not been modified in any way.
Source
Data taken from the covid19dbcand package version 0.1.1
Pain Relievers Misuse in the US
Description
This dataset, drugsmisuse_tbl_df, is a tibble containing information about the use of pain relievers for non-medical purposes in the United States. It includes individual-level data for 100 cases, detailing misuse patterns across various opioid-based medications.
Usage
data(drugsmisuse_tbl_df)
Format
A tibble with 100 observations and 8 variables:
- caseid
Character variable representing the unique case identifier
- hydrocd
Integer variable indicating hydrocodone misuse (1 = Yes, 0 = No)
- oxycodp
Integer variable indicating oxycodone misuse (1 = Yes, 0 = No)
- codeine
Integer variable indicating codeine misuse (1 = Yes, 0 = No)
- tramadl
Integer variable indicating tramadol misuse (1 = Yes, 0 = No)
- morphin
Integer variable indicating morphine misuse (1 = Yes, 0 = No)
- methdon
Integer variable indicating methadone misuse (1 = Yes, 0 = No)
- vicolor
Integer variable indicating Vicodin or similar misuse (1 = Yes, 0 = No)
Details
The dataset name has been kept as 'drugsmisuse_tbl_df' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the MedxR package and assists users in identifying its specific characteristics. The suffix 'tbl_df' indicates that the dataset is a tibble. The original content has not been modified in any way.
Source
Data taken from the package lay version 0.1.3
Search Adverse Events by Drug Name in FDA Adverse Event Reporting System
Description
Retrieves adverse event reports from the FDA Adverse Event Reporting System (FAERS)
that match a specific drug name using the RESTful API endpoint
/drug/event.json?search=<drug_name>
.
This includes details such as the safety report ID, receive date, serious status, patient information, drug details, and adverse reactions for each reported adverse event related to pharmaceutical products.
Usage
get_fda_adverse_events(drug_name)
Arguments
drug_name |
A character string representing the name of the drug. |
Details
This function sends a GET request to the FDA openFDA API. It supports caching via the memoise package to avoid redundant calls, and respects a rate limit between successive API requests.
If the API request fails, returns no matches, or returns an error status code,
the function returns NULL
with an informative message.
Value
A tibble with the following columns:
-
report_id
: Unique identifier for the adverse event report -
date_received
: Date FDA received the report -
country
: Country where event occurred -
serious
: Is it serious? ("Yes", "No", or original API value / NA) -
adverse_reactions
: List of adverse reactions reported (separated by semicolons) or NA -
patient_sex
: Patient sex ("Male", "Female", "Unknown", original API value, or NA) -
patient_age
: Patient age at onset (as returned by API) or NA
Note
Requires an internet connection.
Source
FDA Adverse Event Reporting System (FAERS) via openFDA: https://open.fda.gov/apis/drug/event/
See Also
Examples
# Esta función requiere conexión a internet y descarga datos de la FDA
get_fda_adverse_events("aspirin")
Search Drug Labels by Drug Name in FDA Drug Labeling Database
Description
Retrieves drug label information from the FDA Drug Labeling Database
that match a specific drug name using the RESTful API endpoint
/drug/label.json?search=<drug_name>
.
This includes details such as the product ID, brand name, generic name, indications and usage, dosage and administration, warnings, drug interactions, and other prescribing information from FDA-approved drug labels.
Usage
get_fda_drug_labels(drug_name)
Arguments
drug_name |
A character string representing the name of the drug. |
Details
This function sends a GET request to the FDA openFDA API. It supports caching via the memoise package to avoid redundant calls, and respects a rate limit between successive API requests.
If the API request fails, returns no matches, or returns an error status code,
the function returns NULL
with an informative message.
Value
A tibble with the following columns:
-
product_id
: Unique identifier for the product -
brand_name
: Brand or trade name of the product -
generic_name
: Generic name of the active ingredient -
manufacturer
: Name of the manufacturer -
product_type
: Type of drug product -
route
: Route of administration -
indications
: Approved indications for use -
warnings
: Important warnings and precautions
Note
Requires an internet connection.
Source
FDA Drug Labeling Database via openFDA: https://open.fda.gov/apis/drug/label/
See Also
Examples
# This function requires an internet connection and downloads data from FDA
get_fda_drug_labels("aspirin")
Search FDA-Approved Drugs by Drug Name
Description
Retrieves information about FDA-approved drug products from the official
Drugs at FDA database that match a specific drug name using the RESTful API
endpoint /drug/drugsfda.json?search=<drug_name>
.
This includes details such as the application number, sponsor name, approval dates, product information, application type (NDA, ANDA, BLA), and submission details for brand name drugs, generic drugs, and therapeutic biological products approved by the FDA since 1939.
Usage
get_fda_drugs_approved(drug_name)
Arguments
drug_name |
A character string representing the name of the drug (brand name or generic name). |
Details
This function sends a GET request to the FDA openFDA API. It supports caching via the memoise package to avoid redundant calls, and respects a rate limit between successive API requests.
The Drugs at FDA database contains information about drug products approved since 1939. The majority of labels, approval letters, and reviews are available for products approved since 1998. This database includes brand name drugs, generic drugs, and therapeutic biological products.
If the API request fails, returns no matches, or returns an error status code,
the function returns NULL
with an informative message.
Value
A tibble with the following columns:
-
application_number
: FDA application number (NDA, ANDA, or BLA) -
sponsor
: Name of the company that holds the application -
brand
: Brand or trade name of the approved product -
generic
: Generic (non-proprietary) name of the active ingredient -
type
: Application type (NDA, ANDA, BLA) -
approval_date
: Date the product was approved by FDA -
strength
: Dosage strength of the product -
form
: Pharmaceutical dosage form -
route
: Route of administration
Note
Requires an internet connection.
Source
FDA Drugs at FDA Database via openFDA: https://open.fda.gov/apis/drug/drugsfda/
See Also
Examples
# This function requires an internet connection and downloads data from FDA
get_fda_drugs_approved("aspirin")
get_fda_drugs_approved("lipitor")
Search National Drug Code (NDC) Directory by Drug Name
Description
Retrieves National Drug Code (NDC) information from the FDA NDC Directory
that match a specific drug name using the RESTful API endpoint
/drug/ndc.json?search=<drug_name>
.
This includes details such as the NDC product code, brand name, generic name, labeler information, product type, dosage form, route of administration, marketing status, and active ingredients for pharmaceutical products marketed in the United States.
Usage
get_fda_ndc_directory(drug_name)
Arguments
drug_name |
A character string representing the name of the drug (brand name or generic name). |
Details
This function sends a GET request to the FDA openFDA API. It supports caching via the memoise package to avoid redundant calls, and respects a rate limit between successive API requests.
The NDC Directory contains information on final marketed drugs submitted to FDA in SPL (Structured Product Labeling) electronic listing files. Assignment of an NDC number does not denote FDA approval of the product.
If the API request fails, returns no matches, or returns an error status code,
the function returns NULL
with an informative message.
Value
A tibble with the following columns:
-
ndc
: National Drug Code (NDC) product identifier -
brand
: Brand or proprietary name of the drug product -
generic
: Generic (non-proprietary) name of the drug -
ingredients
: List of active ingredients with strengths -
form
: Pharmaceutical dosage form (e.g., TABLET, CAPSULE) -
route
: Route of administration (e.g., ORAL, INTRAVENOUS) -
labeler
: Name of the company that labels/markets the product -
type
: Type of drug product (e.g., HUMAN PRESCRIPTION DRUG) -
status
: Current marketing status (e.g., Prescription)
Note
Requires an internet connection. The NDC Directory is updated daily by FDA.
Source
FDA National Drug Code Directory via openFDA: https://open.fda.gov/apis/drug/ndc/
See Also
Examples
# This function requires an internet connection and downloads data from FDA
get_fda_ndc_directory("aspirin")
get_fda_ndc_directory("ibuprofen")
Get Active Ingredients from Health Canada Drug Product Database
Description
Retrieves detailed information on all active ingredients
listed in the Health Canada Drug Product Database (DPD)
through the RESTful API endpoint /drug/activeingredient
.
Each record corresponds to a specific active ingredient within a registered drug product, including concentration, unit, and dosage details (if available).
Usage
get_hc_active_ingredients()
Details
The function sends a GET request to the Health Canada DPD API. It uses memoisation via the memoise package to cache results and includes a rate limit delay between API requests.
Missing values are retained as empty strings (""
),
preserving the original schema of the API.
Value
A tibble with the following columns:
-
dosage_unit
: Unit of dosage form (e.g., "ML", " -
dosage_value
: Numeric dosage quantity (e.g., "100") -
drug_code
: Unique code identifying the drug product -
ingredient_name
: Name of the active ingredient -
strength
: Strength or concentration value (e.g., "50", "0.05") -
strength_unit
: Unit of the strength (e.g., "MG", "G", "
Note
Requires an active internet connection.
Source
Health Canada Drug Product Database (DPD) API: https://health-products.canada.ca/api/documentation/dpd-documentation-en.html
See Also
Examples
# This function requires an internet connection and downloads data from Health Canada
get_hc_active_ingredients()
Get Companies from Health Canada Drug Product Database
Description
Retrieves information on all pharmaceutical companies listed in the
Health Canada Drug Product Database (DPD) using the
RESTful API endpoint /drug/company
.
This includes details such as the company code, company name, address, city, province, postal code, and country. Each record corresponds to a company associated with one or more approved or discontinued drug products.
Usage
get_hc_companies()
Details
This function sends a GET request to the Health Canada Drug Product Database API. It supports caching via the memoise package to avoid redundant calls, and includes a small rate limit delay between successive API requests.
The columns post_office_box
and suite_number
are automatically
removed as they generally contain incomplete or irrelevant information.
If the API request fails or returns an error status code,
the function returns NULL
with an informative message.
Value
A tibble with the following columns:
-
company_code
: Unique identifier for the company -
company_name
: Official registered name of the company -
company_type
: Type of company (e.g., "DIN OWNER", "Manufacturer") -
city_name
: City where the company is located -
province_name
: Province or territory (if applicable) -
country_name
: Country name -
postal_code
: Postal code or ZIP code -
street_name
: Street address
Note
Requires an active internet connection.
Source
Health Canada Drug Product Database (DPD) API: https://health-products.canada.ca/api/documentation/dpd-documentation-en.html
See Also
Examples
# This function requires an internet connection and downloads data from Health Canada
get_hc_companies()
Get All DINs from Health Canada Drug Product Database
Description
Retrieves all Drug Identification Numbers (DINs) from the Health Canada
Drug Product Database (DPD) using the RESTful API endpoint /drug/drugproduct
.
Only the DIN column is returned, renamed as din
for convenience.
Usage
get_hc_din()
Details
This function sends a GET request to the Health Canada Drug Product Database API. It supports caching via the memoise package to avoid redundant calls, and respects a rate limit between successive API requests.
If the API request fails or returns an error status code,
the function returns NULL
with an informative message.
Value
A tibble with a single column:
-
din
: The Drug Identification Number
Note
Requires an internet connection.
Source
Health Canada Drug Product Database (DPD) API: https://health-products.canada.ca/api/documentation/dpd-documentation-en.html
See Also
GET
,
fromJSON
,
as_tibble
, rename
Examples
# This function requires an internet connection and downloads data from Health Canada
get_hc_din()
Get a Drug Product by DIN from Health Canada Drug Product Database
Description
Retrieves detailed information for a specific drug product listed in the
Health Canada Drug Product Database (DPD) using the RESTful API endpoint
/drug/drugproduct?din=<DIN>
.
This includes details such as the Drug Identification Number (DIN), product name, class, number of active ingredients, company name, and update date.
Usage
get_hc_drug_by_din(din)
Arguments
din |
A character or numeric string representing the Drug Identification Number (DIN) of the product to retrieve. |
Details
Sends a GET request to the Health Canada Drug Product Database API. Supports caching via the memoise package and enforces a rate limit between successive API requests.
If the DIN does not exist or the API returns an error, the function
returns NULL
with an informative message.
Value
A tibble with the following columns:
-
drug_code
: Unique code identifying the drug product -
class_name
: Class of drug (e.g., Human, Veterinary) -
din
: DIN assigned by Health Canada -
brand_name
: Brand or trade name of the product -
number_of_ais
: Number of active ingredients -
ai_group_no
: Active ingredient group number -
company_name
: Manufacturer name -
last_update_date
: Date of last update in the database
Note
Requires an internet connection.
Source
Health Canada Drug Product Database (DPD) API: https://health-products.canada.ca/api/documentation/dpd-documentation-en.html
See Also
Examples
# This function requires an internet connection and downloads data from Health Canada
get_hc_drug_by_din("02456789")
Retrieve Drug Products from Health Canada Drug Product Database
Description
Retrieves information on all drug products listed in the
Health Canada Drug Product Database (DPD) using the
RESTful API endpoint /drug/drugproduct
.
Optionally, a partial product name can be provided to filter the results to products that contain the search term in their brand name.
Usage
get_hc_drug_products(name = NULL)
Arguments
name |
Optional. A character string representing a partial or complete name of the drug product to filter results. If omitted, returns all available products. |
Details
This function sends a GET request to the Health Canada Drug Product Database API. It supports caching via the memoise package to avoid redundant calls, and respects a rate limit between successive API requests.
If the API request fails, returns no matches, or returns an error status code,
the function returns NULL
with an informative message.
Value
A tibble with the following columns:
-
drug_code
: Unique code identifying the drug product -
class_name
: Class of drug (e.g., Human, Veterinary) -
din
: Drug Identification Number (DIN) -
brand_name
: Brand or trade name of the product -
number_of_ais
: Number of active ingredients -
ai_group_no
: Active ingredient group number -
company_name
: Manufacturer name -
last_update_date
: Date of last update in the database
Note
Requires an internet connection.
Source
Health Canada Drug Product Database (DPD) API: https://health-products.canada.ca/api/documentation/dpd-documentation-en.html
See Also
Examples
# This function requires an internet connection and downloads data from Health Canada
# Retrieve all products
get_hc_drug_products()
# Retrieve products matching a partial name
get_hc_drug_products("acetaminophen")
Get Pharmaceutical Forms from Health Canada Drug Product Database
Description
Retrieves information on all pharmaceutical dosage forms listed in the
Health Canada Drug Product Database (DPD) using the
RESTful API endpoint /drug/form
.
This includes details such as the drug code, form code, and the pharmaceutical form name (e.g., tablet, capsule, solution).
Usage
get_hc_forms()
Details
This function sends a GET request to the Health Canada Drug Product Database API. It supports caching via the memoise package to avoid redundant calls, and respects a rate limit between successive API requests.
If the API request fails or returns an error status code,
the function returns NULL
with an informative message.
Value
A tibble with the following columns:
-
drug_code
: Unique code identifying the drug product. -
pharm_form_code
: Code representing the pharmaceutical form. -
pharm_form_desc
: Description of the pharmaceutical form (e.g., Tablet, Capsule, Solution).
Note
Requires an internet connection.
Source
Health Canada Drug Product Database (DPD) API: https://health-products.canada.ca/api/documentation/dpd-documentation-en.html
See Also
Examples
# This function requires an internet connection and downloads data from Health Canada
get_hc_forms()
Search Drug Products by Brand Name in Health Canada Drug Product Database
Description
Retrieves drug products from the Health Canada Drug Product Database (DPD)
that match a specific brand (commercial) name using the RESTful API endpoint
/drug/drugproduct?search=<brand_name>
.
This includes details such as the Drug Identification Number (DIN), product name, class, number of active ingredients, company name, and update date for each approved or discontinued pharmaceutical product.
Usage
get_hc_search_drug(brand_name)
Arguments
brand_name |
A character string representing the commercial name of the drug. |
Details
This function sends a GET request to the Health Canada Drug Product Database API. It supports caching via the memoise package to avoid redundant calls, and respects a rate limit between successive API requests.
If the API request fails, returns no matches, or returns an error status code,
the function returns NULL
with an informative message.
Value
A tibble with the following columns:
-
drug_code
: Unique code identifying the drug product -
class_name
: Class of drug (e.g., Human, Veterinary) -
din
: Drug Identification Number (DIN) -
brand_name
: Brand or trade name of the product -
number_of_ais
: Number of active ingredients -
ai_group_no
: Active ingredient group number -
company_name
: Manufacturer name -
last_update_date
: Date of last update in the database
Note
Requires an internet connection.
Source
Health Canada Drug Product Database (DPD) API: https://health-products.canada.ca/api/documentation/dpd-documentation-en.html
See Also
Examples
# This function requires an internet connection and downloads data from Health Canada
get_hc_search_drug("NEMBUTAL")
Histamine in Dogs
Description
This dataset, histamine_matrix, is a matrix containing data on blood histamine levels in dogs after drug treatment. Sixteen dogs were used to assess morphine and trimethaphan effects on blood histamine concentration. Dogs were divided into four groups: two received morphine, two received trimethaphan (both intravenous). In each drug pair, one group had histamine depleted prior to treatment, the other retained normal levels. Values of "0.10" indicate originally missing data, arbitrarily imputed with that value.
Usage
data(histamine_matrix)
Format
A numeric matrix with 16 rows and 4 columns:
- Before
Blood histamine levels measured before drug administration
- After1
Histamine levels measured after 1 minute
- After3
Histamine levels measured after 3 minutes
- After5
Histamine levels measured after 5 minutes
Details
The dataset name has been kept as 'histamine_matrix' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the MedxR package and assists users in identifying its specific characteristics. The suffix 'matrix' indicates that the dataset is stored as a matrix object. The original content has not been modified in any way.
Source
Data taken from the msos package version 1.2.0
Digestibility of Straw Treated with NaOH
Description
This dataset, naoh_digest_df, is a data frame containing digestibility coefficients for six horses that were fed straw. Each horse was tested under two conditions: once after being fed ordinary straw and once after being fed straw treated with sodium hydroxide (NaOH).
Usage
data(naoh_digest_df)
Format
A data frame with 6 observations and 3 variables:
- horse
Integer identifier for each horse
- ordinary
Numeric variable representing digestibility after consuming ordinary straw
- naoh
Numeric variable representing digestibility after consuming NaOH-treated straw
Details
The dataset name has been kept as 'naoh_digest_df' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the MedxR package and assists users in identifying its specific characteristics. The suffix 'df' indicates that the dataset is a data frame. The original content has not been modified in any way.
Source
Data taken from the isdals package version 3.0.1
Utilization of Vitamin A in Rats
Description
This dataset, oilvitaminA_df, is a data frame containing vitamin A concentrations in the livers of rats after being fed vitamin A dissolved in different types of oil. Twenty rats were divided into two groups: one received vitamin A in corn oil and the other in castor oil (American oil). After three days of feeding, vitamin A concentration in the liver was measured on the fourth day.
Usage
data(oilvitaminA_df)
Format
A data frame with 20 observations and 2 variables:
- type
Factor variable indicating the oil type used to deliver vitamin A (corn or castor oil)
- avit
Integer variable representing the measured vitamin A concentration in the liver
Details
The dataset name has been kept as 'oilvitaminA_df' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the MedxR package and assists users in identifying its specific characteristics. The suffix 'df' indicates that the dataset is a data frame. The original content has not been modified in any way.
Source
Data taken from the isdals package version 3.0.1
Oral Anticoagulants in Coronary Artery Disease
Description
This dataset, oral_anticoagulants_df, is a data frame containing results from 34 studies evaluating the effectiveness of oral anticoagulants in patients with coronary artery disease. The dataset includes study metadata and outcome counts for treatment and control groups, as well as intensity classifications.
Usage
data(oral_anticoagulants_df)
Format
A data frame with 34 observations and 9 variables:
- study
Character variable identifying each study
- year
Integer variable indicating the publication year
- intensity
Character variable describing treatment intensity
- asp.t
Integer variable indicating the number of aspirin users in the treatment group
- asp.c
Integer variable indicating the number of aspirin users in the control group
- ai
Integer variable indicating the number of adverse events in the treatment group
- n1i
Integer variable for the sample size of the treatment group
- ci
Integer variable indicating the number of adverse events in the control group
- n2i
Integer variable for the sample size of the control group
Details
The dataset name has been kept as 'oral_anticoagulants_df' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the MedxR package and assists users in identifying its specific characteristics. The suffix 'df' indicates that the dataset is a data frame. The original content has not been modified in any way.
Source
Data taken from the package metadat version 1.4-0
Dopamine Agonists in Parkinson's Disease
Description
This dataset, parkinsons_list, is a list containing information from 7 studies investigating the effect of dopamine agonists as adjunct therapy in patients with Parkinson's disease. The dataset includes placebo and four active drugs coded from 2 to 5, measuring outcomes such as lost work-time reduction.
Usage
data(parkinsons_list)
Format
A list with 5 elements:
- Outcomes
Numeric vector representing the reduction in lost work-time for each treatment arm
- SE
Numeric vector indicating the standard error of each observation
- Treat
Character vector identifying the treatment type (placebo or drug)
- Study
Numeric vector indicating the study each observation belongs to
- Treat.order
Character vector listing the treatment names in the order of coding
Details
The dataset name has been kept as 'parkinsons_list' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the MedxR package and assists users in identifying its specific characteristics. The suffix 'list' indicates that the dataset is a list. The original content has not been modified in any way.
Source
Data taken from the package bnma version 1.6.1
Pharmacy Client Attendance
Description
This dataset, pharmacy_tbl_df, is a tibble containing hourly client attendance data in a pharmacy located in Geneva, Switzerland. The dataset spans two years, recording the number of clients per hour alongside the date and weekday.
Usage
data(pharmacy_tbl_df)
Format
A tibble with 17,520 observations and 4 variables:
- date
Date variable indicating the calendar date
- hours
Character variable representing the hour of observation
- weekday
Character variable representing the day of the week
- attendance
Numeric variable indicating the number of clients observed
Details
The dataset name has been kept as 'pharmacy_tbl_df' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the MedxR package and assists users in identifying its specific characteristics. The suffix 'tbl_df' indicates that the dataset is a tibble. The original content has not been modified in any way.
Source
Data taken from the package idarps version 0.0.5
Placebos and Pain Relief
Description
This dataset, placebos_df, is a data frame containing pain relief data from both analgesics and placebos. It presents observations over time comparing the effects of different treatments including placebo, aspirin (Asp), and codis (a combination analgesic), along with calculated placebo reduction.
Usage
data(placebos_df)
Format
A data frame with 7 observations and 6 variables:
- Time
Integer variable indicating the time point of observation
- Placebo
Numeric variable indicating the measured effect of the placebo
- Distr
Numeric variable indicating the measured effect of a distractor treatment
- Asp
Numeric variable indicating the measured effect of aspirin
- Codis
Numeric variable indicating the measured effect of codis
- PlaceboRed
Numeric variable indicating the reduction attributed to the placebo
Details
The dataset name has been kept as 'placebos_df' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the MedxR package and assists users in identifying its specific characteristics. The suffix 'df' indicates that the dataset is a data frame. The original content has not been modified in any way.
Source
Data taken from the package SRMData version 1.0.2
Drug Product Records
Description
This dataset, products_drug_tbl_df, is a tibble containing detailed information on 3,764 commercially available pharmaceutical products in Canada and the United States. Each record includes identifiers such as NDC and DPD codes, marketing start and end dates, strength, dosage form, administration route, approval status, and source agency.
Usage
data(products_drug_tbl_df)
Format
A tibble with 3,764 observations and 19 variables:
- name
Character variable with the commercial name of the drug product
- labeller
Character variable indicating the name of the pharmaceutical company
- ndc-id
Character variable with the U.S. National Drug Code (NDC) identifier
- ndc-product-code
Character variable for the product-level NDC code
- dpd-id
Character variable for the Canadian Drug Product Database (DPD) ID
- ema-product-code
Character variable for the European Medicines Agency product code
- ema-ma-number
Character variable with the EMA marketing authorization number
- started-marketing-on
Character variable indicating marketing start date
- ended-marketing-on
Character variable indicating marketing end date
- dosage-form
Character variable representing the drug's dosage form
- strength
Character variable with the dosage strength
- route
Character variable describing the route of administration
- fda-application-number
Character variable for the FDA application number
- generic
Character variable indicating if the product is a generic formulation
- over-the-counter
Character variable indicating OTC availability
- approved
Character variable specifying whether the product is approved
- country
Character variable indicating the country of approval (Canada/US)
- source
Character variable with the originating regulatory body
- parent_key
Character variable linking to related records
Details
The dataset name has been kept as 'products_drug_tbl_df' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the MedxR package and assists users in identifying its specific characteristics. The suffix 'tbl_df' indicates that the dataset is a tibble data frame. The original content has not been modified in any way.
Source
Data taken from the covid19dbcand package version 0.1.1
Drug Concentration in Rat Livers
Description
This dataset, ratliver_df, is a data frame containing results from an experiment investigating drug absorption in the livers of rats. Nineteen rats were weighed, given an oral dose of approximately 40 mg of drug per kilogram of body weight, and sacrificed after a fixed period. Liver weight and the percentage of the administered dose found in the liver were recorded.
Usage
data(ratliver_df)
Format
A data frame with 19 observations and 4 variables:
- BodyWt
Integer variable indicating body weight of the rat (in grams)
- LiverWt
Numeric variable representing the weight of the liver (in grams)
- Dose
Numeric variable representing the total dose administered (in mg)
- DoseInLiver
Numeric variable representing the percentage of the dose found in the liver
Details
The dataset name has been kept as 'ratliver_df' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the MedxR package and assists users in identifying its specific characteristics. The suffix 'df' indicates that the dataset is a data frame. The original content has not been modified in any way.
Source
Data taken from the isdals package version 3.0.1
Drug Reactions
Description
This dataset, reactions_drug_tbl_df, is a tibble containing detailed information on 69 biochemical reactions involving drug molecules. It includes enzyme-mediated transformations, pharmacological activity of drug metabolites, and mappings between substrates and products as described by DrugBank identifiers.
Usage
data(reactions_drug_tbl_df)
Format
A tibble with 69 observations and 6 variables:
- sequence
Numeric variable indicating the order of the metabolic reaction
- left_drugbank_id
Character variable with the DrugBank ID of the input compound
- left_drugbank_name
Character variable with the name of the input compound
- right_drugbank_id
Character variable with the DrugBank ID of the resulting metabolite
- right_drugbank_name
Character variable with the name of the resulting metabolite
- parent_key
Character variable for linking to external reference records
Details
The dataset name has been kept as 'reactions_drug_tbl_df' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the MedxR package and assists users in identifying its specific characteristics. The suffix 'tbl_df' indicates that the dataset is a tibble data frame. The original content has not been modified in any way.
Source
Data taken from the covid19dbcand package version 0.1.1
View Available Datasets in MedxR
Description
This function lists all datasets available in the 'MedxR' package. If the 'MedxR' package is not loaded, it stops and shows an error message. If no datasets are available, it returns a message and an empty vector.
Usage
view_datasets_MedxR()
Value
A character vector with the names of the available datasets. If no datasets are found, it returns an empty character vector.
Examples
if (requireNamespace("MedxR", quietly = TRUE)) {
library(MedxR)
view_datasets_MedxR()
}