How to work in RMarkdown
Writing in RMarkdown is different to writing in Word. What you see is not quite what you get. To preview what your formatted text will look like, use the “Knit” button on the top bar, or the keyboard shortcut Shift-Command-K.
If you want italics or bold use asterisks.
*one asterisk*
**two asterisks**
one asterisk
two asterisks
You can get levels of heading with hash.
# BIG HEADING
## Smaller Heading
### even smaller heading
You can get bullet points using dash…
- first important point
- second point
- and third...
You can insert code “chunks” by using the shortcut, Option-Command-I or choosing Insert R from the top menu bar.
The power of RMarkdown comes from being able to intersperse code chunks, output, and explanation in the same document.
print("hello world")
[1] "hello world"
Save your image file in the img
folder and tell R where to find it using the include_graphics()
and here::here()
functions
knitr::include_graphics(here::here("img", "band.jpg"))
The RMarkdown reference guide is helpful in learning how to create formatted text in R-Markdown.