0.1 What can RMarkdown be used for?

  1. HTML Reports & PDF Reports
  2. HTML Slide Decks & PowerPoint
  3. Interactive Dashboards
  4. Books with bookdown
  5. Websites with blogdown

0.2 Key Resources

# PDF Knitting Setup: https://yihui.name/tinytex/ 
# install.packages("tintex")
# tinytex::install_tinytex()

1 Write with Markdown

2 Header 1

2.1 Header 2

2.1.1 Header 3

Plain text.

Type bold.

Type italics.

Type bold + italics.

Talk about code - the tidyverse is awesome

Unordered List:

  • Item 1
  • Item 2

Ordered List:

  1. First point
  2. Second point
  3. More points

3 New Hampshire Counties

3.1 Grafton

This is Grafton

3.2 Coos

This is Coos

3.3 Belknap

This is Belknap

4 Images

Images via text section

PSU Logo
PSU Logo

Images via the code chunk

PSU Logo

PSU Logo

5 Code

# Import stock prices
stocks <- tq_get(c("TSLA", "AMZN"),
                 get = "stock.prices",
                 from = "2016-01-01",
                 to = "2017-01-01")
stocks

6 Plots

Plotting works as expected. Try changing:

Static plots:

g <- ggplot(data = stocks) + 
  geom_point(mapping = aes(x = volume, y = adjusted, color = symbol))

g
Revenue by Category

Revenue by Category

Interactive plots:

ggplotly(g)

7 Tables

Static Tables:

stocks %>% head() %>% knitr::kable()
symbol date open high low close volume adjusted
TSLA 2016-01-04 15.38133 15.42533 14.60000 14.89400 102406500 14.89400
TSLA 2016-01-05 15.09067 15.12600 14.66667 14.89533 47802000 14.89533
TSLA 2016-01-06 14.66667 14.67000 14.39867 14.60267 56686500 14.60267
TSLA 2016-01-07 14.27933 14.56267 14.24467 14.37667 53314500 14.37667
TSLA 2016-01-08 14.52400 14.69600 14.05133 14.06667 54421500 14.06667
TSLA 2016-01-11 14.26733 14.29667 13.53333 13.85667 61371000 13.85667

Dynamic Tables:

stocks 

8 Footnotes

This is some text with a Footnote1. This is a second Footnote2.


  1. Citation for Footnote 1↩︎

  2. Citatin for Footnote 2↩︎