<p>I was wondering if there is more elegant way of installing and loading multiple packages in Bioconductor similar to <code>pacman</code> with CRAN packages.</p>
<p>I tried:</p>
<pre><code>
# install and load  the package  manager
 if (!requireNamespace(&quot;BiocManager&quot;, quietly = TRUE))
    install.packages(&quot;BiocManager&quot;)

# install and load bioconductor packages 
bio_pkgs = c(&quot;BiocManager&quot;, &quot;ggbio&quot;, &quot;biomaRt&quot;, &quot;EnsDb.Hsapiens.v75&quot;, &quot;cBioPortalData&quot;, &quot;GenomicRanges&quot;, &quot;GenomicFeatures&quot;, &quot;TxDb.Hsapiens.UCSC.hg19.knownGene&quot;, &quot;Homo.sapiens&quot;)

 if (!requireNamespace(bio_pkgs, quietly = TRUE))
    BiocManager::install(bio_pkgs)

library(easypackages)
libraries(&quot;ggbio&quot;, &quot;biomaRt&quot;, &quot;EnsDb.Hsapiens.v75&quot;, &quot;renvcBioPortalData&quot;, &quot;GenomicRanges&quot;, &quot;GenomicFeatures&quot;, &quot;TxDb.Hsapiens.UCSC.hg19.knownGene&quot;, &quot;Homo.sapiens&quot;)

</code></pre>

<bioconductor>
installing multiple bioconductor packages at once
# installing multiple bioconductor packages at once

(Asked by: username_0 on 2021-01-23)

I was wondering if there is more elegant way of installing and loading multiple packages in Bioconductor similar to pacman with CRAN packages.
I tried:

# install and load  the package  manager
 if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

# install and load bioconductor packages 
bio_pkgs = c("BiocManager", "ggbio", "biomaRt", "EnsDb.Hsapiens.v75", "cBioPortalData", "GenomicRanges", "GenomicFeatures", "TxDb.Hsapiens.UCSC.hg19.knownGene", "Homo.sapiens")

 if (!requireNamespace(bio_pkgs, quietly = TRUE))
    BiocManager::install(bio_pkgs)

library(easypackages)
libraries("ggbio", "biomaRt", "EnsDb.Hsapiens.v75", "renvcBioPortalData", "GenomicRanges", "GenomicFeatures", "TxDb.Hsapiens.UCSC.hg19.knownGene", "Homo.sapiens")

**Tags:** bioconductor

---

## 0 answers

