Text Formatting

  1. This is italics.
  2. This is bold.
  3. This is bold italics.
  • Here is a dot point
    • And here is a nested list
    • Here is a link
    • This is an inline equation using LaTeX rules \(x^2\)
    • And this is a standalone equation \[ a^2+b^2=c^2 \]
  • Below is how you would insert an image from the web

And here is a block quote.

YAML Headers

  • The header at the very top of your markdown document
  • Use this to:
    • change the output document (html_document, pdf_document, word_document)
    • change the theme (default, cerulean, journal, flatly, darkly, readable, spacelab, united, cosmo, lumen, paper, sandstone, simplex, yeti)
    • add a table of contents (see above)

Adding Chunks

You can embed an R code chunk with the add chunk icon:

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
  • see r setup chunk at the start of the document
  • means that including the echo = FALSE parameter in the code chunk prevents printing of the R code that generated the plot.
  • Example below:
##      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

Including Plots

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.

Publishing your R Markdown file