# Reproducibility using R

/ [lectures]   / #rmarkdown #data science #reproducibility

Beyond the availability of data and methods, reproducible science requires the traceability of analyses. Whether it is for yourself or for collaborators, as series of tools and good practices can facilitate your work flow, simplify analyses, and prevent the loss of data and results. This lecture provides an introduction to reproducibility using R.

# Slides

Click on the image below to access the slides:

# Related packages

## knitr

knitr provides excellent resources for literate programming mixing R with LaTeX or markdown.

It is extensively documented at: https://yihui.name/knitr/

To install the current stable, CRAN version of the package, type:

install.packages("knitr")

To benefit from the latest features and bug fixes, install the development version of the package using:

update.packages(ask = FALSE, repos = 'https://cran.rstudio.org')
install.packages('knitr', repos = c('https://xran.yihui.name', 'https://cran.rstudio.org'))

## rmarkdown

rmarkdown extends the capabilities of knitr with a more diverse set of outputs generated from Rmd files, including pdf documents, article templates, pdf or html slides, or even web applications.

More information on rmarkdown is available from: http://rmarkdown.rstudio.com/.

To install this package, type:

install.packages("rmarkdown")

For the devel version, type (uses devtools):

devtools::install_github("rstudio/rmarkdown")

## lintr

lintr will analyse your code and point out deviations from current good coding practices. It can be ran on a .R file, but also can be used to analyse code typed in real-time for a number of coding platforms including Rstudio, emacs and others.

For more information on this package, go to: https://github.com/jimhester/lintr.

To install this package, type:

install.packages("lintr")

# About this document

## Contributors

• Thibaut Jombart: initial version

Contributions are welcome via pull requests. The source files include:

License: CC-BY Copyright: Thibaut Jombart, 2017