forked from saundersg/Statistics-Notebook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRMarkdownHints.Rmd
executable file
·261 lines (153 loc) · 4.19 KB
/
RMarkdownHints.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
---
title: "R Markdown Hints"
output:
html_document:
theme: cerulean
highlight: tango
css: styles.css
---
Think of an `R Markdown File`, or `Rmd` for short, as a command center. You write commands, then Knit the file, and an html output file is created according to your commands.
Study this image to get the idea.

## Creating Headers
There are six available sizes of headings you can use in an Rmd file (left in image) that show up as shown below (right in image).

<br />
# Emphasizing Words
To *italisize* a word use the asterisk (Shift 8) `*italisize*`. To **bold** a word use the double asterisk `**bold**`. (Notice how the back tic ` ` ` can be used to emphasize words as well.)
<br />
# Bullet Points
#### Simple Lists
<div style="float:left;width:300px;">
To achieve the result:
* This is the first item.
* This is the second.
* This is the third.
</div>
<div style="padding-left:350px;">
Use the code:
```{r, eval=FALSE}
* This is the first item.
* This is the second.
* This is the third.
```
</div>
<div style="clear:both;"></div>
#### Numbered Lists
<div style="float:left;width:300px;">
To achieve the result:
1. This is the first item.
2. This is the second.
3. This is the third.
</div>
<div style="padding-left:350px;">
Use the code:
```{r, eval=FALSE}
1. This is the first item.
2. This is the second.
3. This is the third.
```
</div>
<div style="clear:both;"></div>
#### Lettered Lists
<div style="float:left;width:300px;">
To achieve the result:
A) This is the first item.
B) This is the second.
C) This is the third.
</div>
<div style="padding-left:350px;">
Use the code:
```{r, eval=FALSE}
A) This is the first item.
B) This is the second.
C) This is the third.
```
</div>
<div style="clear:both;"></div>
#### Nested Lists
<div style="float:left;width:300px;">
1. What is $2+2$?
a. **4**
b. 8
2. What is $3\times5$?
a. 14
b. **15**
</div>
<div style="padding-left:350px;">
```{r, eval=FALSE}
1. What is $2+2$?
a. **4**
b. 8
2. What is $3\times5$?
a. 14
b. **15**
```
</div>
# Math Equations
Use the dollar signs `$x=5$` to write $x=5$ or `$z=\frac{x-\mu}{\sigma}$` to write $z=\frac{x-\mu}{\sigma}$. For a nicely centered equation use the double dollar signs `$$ $$` on separate lines
```{r, eval=FALSE}
$$
z = \frac{\bar{x}-\mu}{\frac{\sigma}{\sqrt{n}}}
$$
```
to get
$$
z = \frac{\bar{x}-\mu}{\frac{\sigma}{\sqrt{n}}}
$$
Or
```{r, eval=FALSE}
$$
H_0: \mu_1 = \mu_2
$$
$$
H_a: \mu_1 \neq \mu_2
$$
```
to get
$$
H_0: \mu_1 = \mu_2
$$
$$
H_a: \mu_1 \neq \mu_2
$$
<br />
# Insert a Picture
To add a picture to your document, say some notes you took down on paper from class,
``

<br />
# Tables
There are many ways to [make tables](http://rmarkdown.rstudio.com/authoring_pandoc_markdown.html#tables) in R Markdown. Here is a simple way to make a "pipe" table.
```{r, eval=FALSE}
| Name | Age | Gender |
|---------------|---------------|--------------|
| Jill | 8 | Female |
| Jack | 9 | Male |
```
| Name | Age | Gender |
|---------------|---------------|--------------|
| Jill | 8 | Female |
| Jack | 9 | Male |
<br />
# Themes
Notice in the YAML (at the top of the RMD file) there is a line that reads:
"theme: cerulean"
Other possible themes are
* "default", "cerulean", "journal", "flatly", "readable", "spacelab", "united", and "cosmo".
You can also change the `highlighting` by adding the line "highlight: tango" to the YAML as follows.
```{r, eval=FALSE}
---
title: "Markdown Hints"
output:
html_document:
theme: cerulean
highlight: tango
---
```
Other highlighting options are
* "default", "tango", "pygments", "kate", "monochrome", "espresso", "zenburn", "haddock", and "textmate".
<br />
#
# More Information
Go to the [rmarkdown.rstudio.com](http://rmarkdown.rstudio.com/html_document_format.html) website for more information on how to use R Markdown.