easyRef is an R package that generates citations and references for R packages from both CRAN and Bioconductor repositories. It supports RIS and BibTeX formats with automatic DOI retrieval from GitHub repositories and published papers.
- Multi-repository support: Works with both CRAN and Bioconductor packages
- Automatic DOI detection: Retrieves DOIs from package citations, GitHub repositories, and published papers
- Multiple output formats: RIS and BibTeX citation formats
- Command-line interface: Batch processing via command-line script
- GitHub integration: Automatically detects and uses GitHub repository information
- Published paper support: Finds DOIs from associated research papers
# Install from source (development version)
install.packages("devtools")
devtools::install_github("rrydbirk/easyRef")
# Or install locally
install.packages(".", repos = NULL, type = "source")- Required: Base R packages
- Suggested:
BiocManager(for Bioconductor package support)
library(easyRef)
# Generate RIS citation for a CRAN package
result <- createRef("ggplot2")
# Generate citation for a Bioconductor package
result <- createRef("Biobase")
# Generate both RIS and BibTeX formats
results <- createRef(c("ggplot2", "dplyr", "Biobase"), format = "both")
# Write to file
createRef("ggplot2", filename = "ggplot2_citation.ris")# Convenience function for Bioconductor packages
result <- createBiocRef("Biobase")
# Multiple Bioconductor packages
bioc_packages <- c("Biobase", "limma", "edgeR", "DESeq2")
results <- createBiocRef(bioc_packages, format = "both")# Generate RIS citation for a single package
Rscript inst/scripts/generate_refs.R ggplot2
# Generate both formats for multiple packages
Rscript inst/scripts/generate_refs.R --format both --out citations/ ggplot2 dplyr Biobase
# Generate separate files for each package
Rscript inst/scripts/generate_refs.R --format both --split --out citations/ ggplot2 dplyr Biobase
# Show help
Rscript inst/scripts/generate_refs.R --help- Standard R packages from the Comprehensive R Archive Network
- Examples:
ggplot2,dplyr,tidyr
- Bioinformatics packages from Bioconductor
- Examples:
Biobase,limma,edgeR,DESeq2,GenomicRanges - Requires
BiocManagerpackage for full functionality
The package automatically attempts to retrieve DOIs from multiple sources:
- Package citations: Built-in citation information
- Package metadata: DESCRIPTION file DOI fields
- GitHub repositories: README and CITATION files
- Published papers: Associated research publications
TY - COMP
AU - Wickham, Hadley
TI - ggplot2: Create Elegant Data Visualisations
PY - 2016
PB - Comprehensive R Archive Network (CRAN)
UR - https://ggplot2.tidyverse.org
DO - 10.1000/182
M3 - Computer software
N1 - R package version 3.4.0
ER -
@misc{ggplot2_2016,
author = {Wickham, Hadley},
title = {ggplot2: Create Elegant Data Visualisations},
year = {2016},
url = {https://ggplot2.tidyverse.org},
note = {R package version 3.4.0}
}# Generate citation for a research paper's associated package
result <- createRef("DESeq2")
cat(result$ris)# Generate citations for all packages used in a project
packages <- c("ggplot2", "dplyr", "Biobase", "limma", "edgeR")
results <- createRef(packages, format = "both", filename = "project_citations.ris")# Generate citations for all packages in a requirements file
cat requirements.txt | xargs Rscript inst/scripts/generate_refs.R --format both --out citations/The package automatically detects the appropriate repository (CRAN or Bioconductor) for each package. For Bioconductor packages, ensure BiocManager is installed:
install.packages("BiocManager")The package automatically detects GitHub repositories from package URLs and attempts to retrieve DOI information from:
- README.md files
- inst/CITATION files
- Repository topics and descriptions
-
Bioconductor packages not found: Install
BiocManagerinstall.packages("BiocManager") -
DOI not found: The package will work without DOIs, but for better citations, ensure packages have proper citation information
-
GitHub access issues: The package uses public GitHub URLs, so no authentication is required
The package includes comprehensive error handling and will gracefully fall back to available information if some sources are unavailable.
Contributions are welcome! Please feel free to submit issues and pull requests.
MIT License - see LICENSE file for details.
If you use easyRef in your research, please cite it:
citation("easyRef")