Learning objectives
- Understanding dynamic document types
- Learning basics of Markdown and RMarkdown
- A brief introduction to the many options
- Dynamic web based content (i.e., flexdashboards)
- Static rendering to pdf, word, or html
- The many templates that exist already
.Rmd
)This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
summary(cars)
## speed dist
## Min. : 4.0 Min. : 2.00
## 1st Qu.:12.0 1st Qu.: 26.00
## Median :15.0 Median : 36.00
## Mean :15.4 Mean : 42.98
## 3rd Qu.:19.0 3rd Qu.: 56.00
## Max. :25.0 Max. :120.00
There are loads of options within these .Rmd
files, all largely based around how you format the yaml
header within these documents. Much of this has been designed to make it easy to setup/customize as much or as little as you are interested in.
yaml
You can also embed plots, for example:
Note that the echo = FALSE
parameter was added to the code chunk to prevent printing of the R code that generated the plot.
North Fork American Streamlapse: March-April 2016 from Center for Watershed Sciences on Vimeo.
These are very cool documents that are sort of like interactive and dynamic webpages. You can provide a number of different panels (customized as you like), which can display data in an interactive and exploratory way.
With just one added file (a template), and installing a program called LaTeX, it is possible to maintain/update your CV using RStudio and RMarkdown. Some folks have even developed templates for manuscripts and dissertations using this method! What follows is an adaptation from Steven Miller’s excellent post and associated code with a few formatting changes.
The following lesson/showcase will require 3 pieces:
You’ll need the rap-latex-cv.tex
file (the template that dictates how the PDF will look), you can download from here
And you’ll need the actual template-2pg-cv.Rmd
file, here.
LaTex
distribution installed (see here, note: it is a big file and will take a little time to install the first time)pdfLaTex
selected in the Sweave options (see here for more info on checking this).CV Example