Tutorial
Document & Publish Your Workflow: R Markdown & knitr
Last Updated: Apr 8, 2021
Authors:
Last Updated: Apr 8, 2021
This tutorial we will work with the knitr
and rmarkdown
packages within
RStudio
to learn how to effectively and efficiently document and publish our
workflows online.
At the end of this activity, you will be able to:
knitr
package.As we read in the Reproducible Science overview, the four facets of reproducible science are:
This week we will learn about the R Markdown file format (and R package) which
can be used with the knitr
package to document and publish (disseminate) your
code and code output.
View Slideshow: Share, Publish & Archive - from the Reproducible Science Curriculum
“R Markdown is an authoring format that enables easy creation of dynamic documents, presentations, and reports from R. It combines the core syntax of markdown (an easy to write plain text format) with embedded R code chunks that are run so their output can be included in the final document. R Markdown documents are fully reproducible (they can be automatically regenerated whenever underlying R code or data changes)." -- RStudio documentation.
We use markdown syntax in R Markdown (.rmd) files to document workflows and to share data processing, analysis and visualization outputs. We can also use it to create documents that combine R code, output and text.
There are many advantages to using R Markdown in your work:
The knitr
package for R allows us to create readable documents from R Markdown
files.
In the next tutorial we will learn more about working with the R Markdown format in RStudio.