This report demonstrates R Markdown’s capabilities.
Hint: You need to replicate this report EXACTLY, except you should ignore Hints and replace the name and date in the YAML header.
Hint: There are 3 section header sizes used in this report. The Introduction is the largest header size.
Hint: Automatically generate a table of contents by specifying the following output
settings in your YAML header:
output:
html_document:
toc: true
toc_depth: 3
Hint: You can find the syntax to do everything in the R Markdown reference guide that I mentioned in the Assignment!
This section demonstrates text formatting.
R Markdown uses the knitr
R package under the hood. You can knit documents by pressing the Knit button in R Studio. Amazing!
Hint: Be sure the hyperlink you create actually works! The link above should send you to the home page for R Markdown.
Hint: The word ‘knitr’ above is formatted as in-line code. It doesn’t get run like a real code block. It is just a special way to highlight text.
Lists are a useful way to summarize important information.
You can create numbered lists:
Or you can create bullet points:
Hint: There must be a single space between your number/bullet and the text. For example, * Banana
will work, but *Banana
will not.
Hint: Indent four spaces to produce the second-level bullet points (Green apple and Red apple).
This is a good quote:
All models are wrong, but some are useful. - George Box
# Say hello
print('Hello World!')
## [1] "Hello World!"
# A sum of two and two
x <- 2 + 2
x
## [1] 4
# A sequence from 1 to 10
1:10
## [1] 1 2 3 4 5 6 7 8 9 10
Hint: You can write all of the code in a single block and the multiple outputs automatically get split up.
# Say hello
print('Hello World!')
# A sum of two and two
x <- 2 + 2
x
# A sequence from 1 to 10
1:10
Hint: You need eval=FALSE
in your code block settings.
# Simulate random data
set.seed(1)
data <- rnorm(100)
# Plot data
hist(data, main='My Histogram', col='hotpink')
The mosquito photograph below can be found at URL https://i.imgur.com/ed1sT04.jpg
.
Hint: I like to upload images to imgur and use the resulting URL to embed them in my R Markdown documents.
Hint: You can also use HTML tags in R Markdown documents. For example, to center the image above, you could wrap the embedded image in HTML tags: <center>![](https://link.to.image)</center>
.