In this document, we will start to learn the basic syntax to use R markdown to write document. Within a R markdown file, we could have descriptive text, math equations, code chunk, and other settings. R markdown also ignore multiple spaces, like this, would just get one space. If you really want to add extra space within your text, use non breaking space tag: , then you got extra three space. Want a new line, but fail even though with a carriage return.
Start a new line with two blank spaces. Within R markdown, trying two blank spaces works like rebooting your machine when something does not work.
italics and bold or italics and bold.
strikethrough
superscript2
subscript3
There is no defined underline syntax in R markdown. But R markdown also takes HTML tags, so we could use underline for underline.
We also could use them together, e.g. underline and bold, italics and bold, underline and bold and italics
A footnote 1
Have an unordered list first:
Have an ordered list then:
Sometimes, two blank spaces are necessary between two items when using some template.
R code chunk:
<- 2
x print(x)
## [1] 2
It is better to name your code chunk. Two chunks cannot have the same name. And specify chunk options based on your need.
Inline code with evaluation 12 .
Inline code just for display sum
.
Insert an image using
or we could use code chunk to insert:
We could insert a link using link.
Inline equation: \(A = \pi*r^{2}\)
Equation chunk: \[A = \pi*r^{2}\]
blockquote here
blockquote paragraph1
blockquote paragraph2
blockquote
Nested blockquote
inside of blockquote, other also works
- quote 1
- quote 2
Nested blockquote
here is footnote 1.↩︎