Heading 1

Heading 2

Heading 6

Some text, including emphasis and extra emphasis.

# comment. A comment is preceded by "#", while text is preceded by "#' ".

Plots are added very easily.

plot(1:10,sample(1:10,10),type="l")  

Leave a blank line in the file after plots to make the next text start on a new line. Leave two spaces (" “) at the end of a text line to start the next text line as a new paragraph. If you want to leave a blank line between paragraphs, add#' (#' with two spaces). To have part of your text formatted as code, wrap it in backticks (usually found above the tab key, with the ‘~’). For example sum(1:10).

# The last example looked like this  
# `sum(1:10)` 
# in a line that starts with #' 

So we can have “code” that doesn’t do anything and we can have thing doen with out seeing the code:

##  [1] "v" "j" "k" "s" "y" "u" "i" "n" "w" "n" "s" "z" "d" "n" "y" "p" "i"
## [18] "q" "e" "f" "z" "n" "x" "d" "l" "x"

Notice the code that produced the random sampling of letters above did not show up? Placing a comment like this #+ echo=FALSE in front of some code prevents the code from showing. Useful for making plots while not showing the code. Lines preceded with #+ are “chunk options” that control how following code is displayed. The same plot with some more options - we can add thing to the “#+….” line - in this case I used #+ fig.dim=c(5,2),echo=FALSE to make the figure 5x2 inches and suppress printing the code for the plot.

Text with some inline code: The mean time length of Old Faithful eruptions is: 3.4877831 minutes.

# inline code is in the form `r mean(x)` when the comment is preceded by #'

To add a horizontal rule you can add #' -----, but you need a blank line (#') above and below.


You can find another example at https://github.com/yihui/knitr/blob/master/inst/examples/knitr-spin.R. All I had to do to create the link is to paste the address in and the link is created when I compile.