forked from fels-bioinformatics/fels_bioinformatics_meetup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
week1_intro_to_rmarkdown_practice.Rmd
110 lines (66 loc) · 2.16 KB
/
week1_intro_to_rmarkdown_practice.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
---
output:
word_document: default
pdf_document: default
html_document: default
---
```{r setup, include=FALSE}
library(tidyverse)
library(viridis)
knitr::opts_chunk$set(echo = TRUE)
```
# R Markdown Practice
## Practice with Code Chunks
### Practice Running Code Chunks
First, things first, run the code chunk at the very top of the document, to set things up. Remember you can run a code chunk by:
1. Clicking the green arrow on the upper right hand side of the code chunk
2. Clicking "Run Current Chunk" in the "Run" drop down menu above
3. Hitting `Command` + `Shift` + `Return` on a Mac or `Ctrl` + `Shift` + `Enter` on a PC
Now try running code chunks each of the three ways. Run the first chunk below using the arrow inside it
```{r}
image(volcano, col = viridis(200))
```
Run this code chunk using the Run drop down menu
```{r}
image(volcano, col = viridis(200))
```
Run this code chunk using keyboard commands
```{r}
image(volcano, col = viridis(200))
```
You should have gotten the same output for all three chunks.
### Make Your Own Code Chunk
Remember, to create a code chunk
1. Type three backticks (\`)
2. Type curly braces ({})
3. Type a lowercase r inside the curly braces
4. Hit Enter twice
5. Type three more backticks on the next line.
Make your own code chunk in the space below, and then copy the code between backticks `image(volcano, col = viridis(200, option = 'A'))` and try running it.
## Practice with Text Formatting
For the lines of text below, add the appropriate symbols to make the text what it says. For example, if the line says, "Make me inline text" add backticks around it so it becomes inline text, `Make me inline text`. You can always reference the class materials or Google for help.
---
Make me bold
---
Make me italicized
---
Make me a header (whatever size you want)
---
Make me a different size of header (just not the same as the line above)
---
Make the stuff below into an unordered list.
satsuma
tomato
plum
star fruit
cherry
---
Make the stuff below into an ordered (numbered) list.
banana
pineapple
apricot
grape
pomegranate
## Knit
Finally, try knitting this by hitting the `Knit` button in RStudio
<br><br>