Last data update: 2014.03.03

R: Link to packages on Bioconductor, CRAN and GitHub
macrosR Documentation

Link to packages on Bioconductor, CRAN and GitHub

Description

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

Usage

Biocpkg(pkg)
CRANpkg(pkg)
Githubpkg(repo, pkg)
Rpackage(pkg)

Arguments

pkg

character(1), package name

repo

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

Details

Use Biocpkg for Bioconductor software, annotation and experiment data packages. The function automatically includes a link to the release landing page or if the package is only in devel, to the devel landing page.

Use CRANpkg for R packages available on CRAN. The function automatically includes a link to the FHCRC CRAN mirror 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.

Author(s)

Andrzej Ole<c3><85><c2><9b> <andrzej.oles@embl.de>, 2014-2015

Examples


## link to a Bioconductor package
Biocpkg("IRanges")

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

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

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BiocStyle)
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/BiocStyle/macros.Rd_%03d_medium.png", width=480, height=480)
> ### Name: macros
> ### Title: Link to packages on Bioconductor, CRAN and GitHub
> ### Aliases: Biocpkg Biocannopkg Biocexptpkg CRANpkg Rpackage Githubpkg
> 
> ### ** Examples
> 
> 
> ## link to a Bioconductor package
> Biocpkg("IRanges")
[1] "*[IRanges](http://bioconductor.org/packages/IRanges)*"
> 
> ## link to a CRAN package
> CRANpkg("data.table")
[1] "*[data.table](http://cran.fhcrc.org/web/packages/data.table/index.html)*"
> 
> ## link to an R package on GitHub
> Githubpkg("rstudio/rmarkdown")
[1] "*[rmarkdown](https://github.com/rstudio/rmarkdown)*"
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>