macros: Link to packages on Bioconductor, CRAN and GitHub

Description Usage Arguments Details Value Author(s) Examples

Description

Functions for adding links to Bioconductor, CRAN and GitHub packages into R Markdown documents.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
Biocpkg(pkg, vignette = NULL, label = NULL)

Biocbook(pkg, label = NULL)

Biocannopkg(pkg)

Biocexptpkg(pkg)

CRANpkg(pkg)

Rpackage(pkg)

Githubpkg(repo, pkg)

Arguments

pkg

character(1), package name

vignette

character(1), basename of vignette link, including html or pdf extension, e.g., "work-0-intro.html".

label

character(1) label used to identify the package or vignette. If NULL, defaults to pkg.

repo

Repository address in the format username/repo[/subdir]

Details

Use Biocpkg for Bioconductor software, annotation, experiment data, and workflow packages. When vignette=NULL, the function automatically includes a link to the package landing page, the version of which depends on the current Bioconductor version (i.e. if run in a devel environment, it will point towards the devel landing page; otherwise it will point to the release landing page).

Use Biocbook for Bioconductor webbooks. This will create a link to the index page of the book rather than to the landing page of the package used for the book's deployment.

Use CRANpkg for R packages available on CRAN. The function automatically includes a link to the master CRAN landing page.

Use Githubpkg for R packages available on GitHub. The repo should include the repository address in the format username/repo[/subdir]. If package is missing, the package name is assumed to be equal the repository name and is extracted from repo.

For R packages which are not available on Bioconductor, CRAN or GitHub, use Rpackage.

Value

Markdown-formatted character vector containing a hyperlinked package name. If vignette != NULL, the address of the specified vignette is returned.

Author(s)

Andrzej OleÅ› <andrzej.oles@embl.de>, 2014-2015

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## link to a Bioconductor software package
Biocpkg("IRanges")

## link to a Bioconductor annotation package
Biocpkg("org.Mm.eg.db")

## link to a Bioconductor experiment data package
Biocpkg("affydata")

## link to a Bioconductor workflow
Biocpkg("simpleSingleCell")
Biocpkg(
    "simpleSingleCell",
    vignette = "work-0-intro.html",
    label = "Episode 1: analyzing scRNA-seq data with R/Bioconductor"
)

## link to a CRAN package
CRANpkg("data.table")

## link to an R package on GitHub
Githubpkg("rstudio/rmarkdown")

aoles/BiocStyle documentation built on Oct. 15, 2021, 4:50 a.m.