1. Overview
R packages are libraries that extend the functionality of R. They include functions, data, and documentation in a convenient format that is easy to install, reuse, and share with others.
Why Create R Packages?
- Reusable code: Complex analyses or algorithms can be encapsulated in functions, organized into a package, and reused in the future.
- Process standardization: Packages provide a standardized tool for data analysis that can be used across teams or projects.
- Clear documentation: Packages include usage examples and function descriptions, making them easier to understand.
- Integration: Packages easily integrate with each other, creating an ecosystem of tools.
- Public availability: Packages can be shared with colleagues or published in public repositories like CRAN, GitHub, or Bioconductor.
- Ease of installation: Users can quickly install a package using commands like:
install.packages("")
devtools::install_github("")
BiocManager::install("") # from Bioconductor
Popular R Packages for Bioinformatics (Bioconductor Repository)
- edgeR, DESeq2, Limma: For differential gene expression analysis.
- GenomicRanges: For working with genomic coordinates.
- Biostrings: For analyzing DNA, RNA, and protein sequences.
- tidyverse: Although not specific to bioinformatics, it is widely used for data manipulatio bioinformatics (e.g., dplyr, ggplot2).
- phyloseq: For microbiome data analysis.
- pheatmap: For creating heatmaps, commonly used in bioinformatics.
R Packages for Creating R Packages :)
- devtools: Simplifies the creation, development, and testing of packages.
Functions: create(), install(), check().
- roxygen2: For generating documentation.
Documentation is written as comments in the code, and a NAMESPACE file is automatically generated.
- usethis: Automates package structure creation.
Creates folders (R/, tests/, man/), README templates, LICENSE files, and more.
- testthat: For writing tests.
Helps with testing package functions.
- pkgdown: For generating a package website with documentation.
- rcmdcheck: Checks the package for compliance with CRAN standards.