+ - 0:00:00
Notes for current slide
Notes for next slide

POL 478H1 F

R, Rstudio, and RMarkdown

Olga Chyzh [www.olgachyzh.com]

1 / 9

Software to Download

2 / 9

The RStudio IDE

3 / 9

Markdown

  • Markdown is a markup language.

  • Markup languages help produce documents (e.g., web pages, pdfs) from plain text.

  • Other markup languages include LaTeX, HTML, and xml.

  • Markdown has become widespread. Many websites will generate HTML from Markdown (e.g. GitHub, Stack Overflow, reddit, ...).

4 / 9

Basic Markdown

*italic*
**bold**
#Header 1
## Header 2
### Header 3
- List item 1
- List item 2
- item 2a
- item 2b
1. Numbered list item 1
2. Numbered list item 2

Check out RStudio's RMarkdown cheat sheet

5 / 9

What is RMarkdown

  • R Markdown is a file format for making dynamic documents with R.

  • An R Markdown document is written in Markdown and contains chunks of embedded R code.

  • Allows for regenerating the document whenever the code/data/text changes.

  • Also supports HTML and LaTeX.

6 / 9

7 / 9

8 / 9

Your Turn

  1. Open RStudio and create a new Rmarkdown document. Save it with name myfirstmarkdown.Rmd

  2. Knit it.

  3. Go to your folder and open myfirstmarkdown.html file.

  4. Go back to Rstudio and edit the first Markdown chunk to say:

    With RMarkdown, you can...

    1. Make ordered lists
    2. Type text in italics
    3. or in bold
    4. or verbatim
    5. And you can even do this
    6. Here is how you make a subscript 2 and a superscript 2

Hint: Use RStudio's RMarkdown cheat sheet to figure out how to complete items 2--6.

9 / 9

Software to Download

2 / 9
Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
Esc Back to slideshow