Instructions on enabling Bioconductor style in your R markdown vignettes.
In order to build .Rmd documents the rmarkdown package is necessary, which relies on pandoc to compile the final output document. If you are working within a recent version of RStudio then both rmarkdown and pandoc should be already installed.
If you are missing the rmarkdown package then you can install it from CRAN using
install.packages("rmarkdown")
In this case a recent version of pandoc (>= 1.12.3) is also required. See the pandoc installation instructions for details on installing pandoc for your platform.
BiocStyle introduces the following macros useful when referring to R packages:
`r Biocpkg("IRanges")`
for Bioconductor software packages, including a link to the release version landing page, IRanges.
`r Biocannopkg("org.Hs.eg.db")`
for Bioconductor annotation packages, including a link to the release version landing page, org.Hs.eg.db.
`r Biocexptpkg("parathyroidSE")`
for Bioconductor experiment data packages, including a link to the release version landing page, parathyroidSE.
`r CRANpkg("data.table")`
for R packages available on CRAN, including a link to the FHCRC CRAN mirror landing page, data.table.
`r Githubpkg("rstudio/rmarkdown")`
for R packages available on GitHub, including a link to the package repository, rmarkdown.
`r Rpackage("MyPkg")`
for R packages that are not available on Bioconductor, CRAN or GitHub; MyPkg.
Compared to the default markdown appearance the formatting differences include:
Images and tables appear centered, e.g.
v = seq(0, 60i, length = 1000)
plot(abs(v)*exp(v), type = "l", col = "Royalblue")
Tables are displayed with striped rows:
Fruit | Price
------- | -----
bananas | 1.2
apples | 1.0
oranges | 2.5
produces
Fruit | Price |
---|---|
bananas | 1.2 |
apples | 1.0 |
oranges | 2.5 |
Paragraph text is justified
External links open in new browser tab/window
Math symbols can be included in markdown documents. You can write math expressions the same way you would in Latex
, except some differences in escaping them.
Inline: For inline formulas use $P(x) = \frac{1}{2}$
or \(P(x) = \frac{1}{2}\)
, which both render as \(P(x) = \frac{1}{2}\).
Standalone: Math can be displayed in a separate line by writing $$P(x) = \frac{1}{2}$$
or \[P(x) = \frac{1}{2}.\]
, which both result in \[P(x) = \frac{1}{2}.\]
Here is the output of sessionInfo()
on the system on which this document was compiled:
## R version 3.2.2 (2015-08-14)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 14.04.3 LTS
##
## locale:
## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
## [3] LC_TIME=en_US.UTF-8 LC_COLLATE=C
## [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
## [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
## [9] LC_ADDRESS=C LC_TELEPHONE=C
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] BiocStyle_1.8.0
##
## loaded via a namespace (and not attached):
## [1] magrittr_1.5 formatR_1.2.1 htmltools_0.2.6 tools_3.2.2
## [5] yaml_2.1.13 stringi_0.5-5 rmarkdown_0.8.1 knitr_1.11
## [9] stringr_1.0.0 digest_0.6.8 evaluate_0.8