Introduction to R Markdown

This document comes from a UH-Mānoa data science group for linguists presentation

This is a top level section

R Markdown

This is an R Markdown presentation. 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.

Slide with Bullets

  • Bullet 1
    • Sub bullet 1
  • Bullet 2
    • Sub bullet 2
      • Subsub bullet 2
  • Bullet 3

Slide with R Output

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

Slide with Plot

Another top level section

R Environment settings

  • {r optional_name, eval=T,cache=T,message=F,warning=F,echo=T}
  • In text R code: 24.3649879

Including Non-R generated images

Tables from Data Frames: sjPlot

    speed
    B CI p
(Intercept)   8.28 6.53 – 10.04 <.001
dist   0.17 0.13 – 0.20 <.001
Observations   50
R2 / adj. R2   .651 / .644

Table: Pander

Fitting linear model: speed ~ dist
  Estimate Std. Error t value Pr(>|t|)
(Intercept) 8.284 0.8744 9.474 1.441e-12
dist 0.1656 0.01749 9.464 1.49e-12

Table: Pander

speed dist
4 2
4 10
7 4
7 22
8 16
9 10
10 18
10 26
10 34
11 17
11 28
12 14
12 20
12 24
12 28
13 26
13 34
13 34
13 46
14 26
14 36
14 60
14 80
15 20
15 26
15 54
16 32
16 40
17 32
17 40
17 50
18 42
18 56
18 76
18 84
19 36
19 46
19 68
20 32
20 48
20 52
20 56
20 64
22 66
23 54
24 70
24 92
24 93
24 120
25 85

Table: Kable

speed dist
4 2
4 10
7 4
7 22
8 16
9 10
10 18
10 26
10 34
11 17
11 28
12 14
12 20
12 24
12 28
13 26
13 34
13 34
13 46
14 26
14 36
14 60
14 80
15 20
15 26
15 54
16 32
16 40
17 32
17 40
17 50
18 42
18 56
18 76
18 84
19 36
19 46
19 68
20 32
20 48
20 52
20 56
20 64
22 66
23 54
24 70
24 92
24 93
24 120
25 85

Table: Kable

Estimate Std. Error t value Pr(>|t|)
(Intercept) 8.28 0.87 9.47 0
dist 0.17 0.02 9.46 0

Formatting Text

Related