library(faers)
# 1. Check metadata of FAERS
faers_meta(internal = TRUE)
# 2. Download and parse quarterly data files
data2 <- faers(
c(2004, 2017),
c("q1", "q2"),
dir = system.file("extdata", package = "faers"),
compress_dir = tempdir()
)
# 3. Retrieve specific field data (e.g., demographic data)
demo_data <- faers_get(data2, "demo")
# 4. Load standardized data and retrieve MedDRA hierarchy
data_std <- readRDS(system.file("extdata", "standardized_data.rds", package = "faers"))
meddra_hier <- faers_meddra(data_std, use = "hierarchy")
Input/Output Note: Inputs are year, quarter, and directory paths for FAERS raw data; outputs are standardized FAERS data tables and MedDRA hierarchy mappings.
When to Use
Accessing and parsing the FDA Adverse Event Reporting System (FAERS) quarterly data files.
Retrieving specific demographic, drug, or reaction fields using faers_get.
Standardizing drug and reaction terms to MedDRA terminology using faers_standardize and faers_meddra.
When NOT to Use
For analyzing clinical trial adverse events that are not part of the FAERS public database.
For real-time adverse event tracking (FAERS data is released quarterly).
Data Requirements
Raw FAERS quarterly data files (ASCII or XML format).
MedDRA terminology files for standardization.
Key Parameters
internal (FALSE): Logical indicating whether to use internal cached FAERS metadata in faers_meta.
dir: Directory path where FAERS data files are stored or downloaded.
compress_dir: Temporary directory for uncompressing downloaded files.
use ("hierarchy"): Component of MedDRA to retrieve (e.g., "hierarchy" or "SMQ").
Best Practices
Check FAERS metadata using faers_meta(internal = TRUE) to verify available quarters and file sizes before downloading.
Use faers_combine to merge multiple quarters of parsed FAERS data into a single object.
Standardize drug and reaction terms using faers_standardize with a valid MedDRA path to ensure consistent terminology.
Common Pitfalls
Attempting to run standardization without providing a valid path to uncompressed MedDRA data. Ensure meddra_path is correctly specified.
Alternatives
openfda: For querying the OpenFDA API directly instead of parsing raw quarterly files.
Citations
FDA Adverse Event Reporting System (FAERS) documentation.
1---2name: faers3description: faers4---56# faers78## Workflows910### Standard Workflow1112```r13library(faers)1415# 1. Check metadata of FAERS16faers_meta(internal = TRUE)1718# 2. Download and parse quarterly data files19data2 <- faers(20 c(2004, 2017), 21 c("q1", "q2"), 22 dir = system.file("extdata", package = "faers"), 23 compress_dir = tempdir()24)2526# 3. Retrieve specific field data (e.g., demographic data)27demo_data <- faers_get(data2, "demo")2829# 4. Load standardized data and retrieve MedDRA hierarchy30data_std <- readRDS(system.file("extdata", "standardized_data.rds", package = "faers"))31meddra_hier <- faers_meddra(data_std, use = "hierarchy")32```33**Input/Output Note:** Inputs are year, quarter, and directory paths for FAERS raw data; outputs are standardized FAERS data tables and MedDRA hierarchy mappings.3435## When to Use36- Accessing and parsing the FDA Adverse Event Reporting System (FAERS) quarterly data files.37- Retrieving specific demographic, drug, or reaction fields using `faers_get`.38- Standardizing drug and reaction terms to MedDRA terminology using `faers_standardize` and `faers_meddra`.3940## When NOT to Use41- For analyzing clinical trial adverse events that are not part of the FAERS public database.42- For real-time adverse event tracking (FAERS data is released quarterly).4344## Data Requirements45- Raw FAERS quarterly data files (ASCII or XML format).46- MedDRA terminology files for standardization.4748## Key Parameters49- **internal** (`FALSE`): Logical indicating whether to use internal cached FAERS metadata in `faers_meta`.50- **dir**: Directory path where FAERS data files are stored or downloaded.51- **compress_dir**: Temporary directory for uncompressing downloaded files.52- **use** (`"hierarchy"`): Component of MedDRA to retrieve (e.g., `"hierarchy"` or `"SMQ"`).5354## Best Practices55- Check FAERS metadata using `faers_meta(internal = TRUE)` to verify available quarters and file sizes before downloading.56- Use `faers_combine` to merge multiple quarters of parsed FAERS data into a single object.57- Standardize drug and reaction terms using `faers_standardize` with a valid MedDRA path to ensure consistent terminology.5859## Common Pitfalls60- Attempting to run standardization without providing a valid path to uncompressed MedDRA data. Ensure `meddra_path` is correctly specified.6162## Alternatives63- `openfda`: For querying the OpenFDA API directly instead of parsing raw quarterly files.6465## Citations66- FDA Adverse Event Reporting System (FAERS) documentation.6768## References69- Homepage: bioconductor.org/packages/faers70- Vignette: https://bioconductor.org/packages/release/bioc/vignettes/faers/inst/doc/FAERS-Pharmacovigilance.html
Run npx skillmds@latest add biomate-ai/faers in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
faers It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
biomate-ai (@biomate-ai) published this skill. Their other Agent Skills are listed on their SkillMD profile.