MarkDown Syntax Examples

This is my first line. # comment shows line end This would be a new line. This wouldn’t be a new line.

This is my first paragraph.

This is my second paragraph

Italics = Italics or Italics
Bold = Bold or Bold

alt text alt text

Top level section

Middle level section

Bottom level section

  • First item
  • Second item
  • Second item A
  • Second item B
  1. First item
  2. Second item
  • Second item A
  • Second item B
hist(rnorm(100))

http://mrccsc.github.io Github site

Before the first page break *** Before the second page break

R code chunks examples

rMarkdown

hist(rnorm(1000))

rMarkdown. Controlling R code output - eval

hist(rnorm(1000))

rMarkdown. Controlling R code output - Displaying code.

rMarkdown. Controlling R code output - message and warnings

library(ggplot2)

rMarkdown. Controlling figure output.

hist(rnorm(100))

rMarkdown. Automatically tidying code.

hist(rnorm(100))

rMarkdown. Placing code and output together

temp <- rnorm(10)
temp
##  [1] -1.9145498  0.3996941  0.1826279 -0.7984255  0.3628835  0.6136589
##  [7] -1.8280572 -0.5396242  0.1228731  0.9298224

rMarkdown. Inserting tables.

library(knitr)
temp <- rnorm(10)
temp2 <- rnorm(10)
dfExample <- cbind(temp,temp2)
kable(dfExample)
temp temp2
0.6445739 2.2337503
-1.2655764 0.7595957
0.6627824 0.2209622
-0.2467422 -0.1673631
-2.1573396 0.2983872
-0.8453269 -0.5156510
-0.3634574 -0.7634597
-1.3594541 -1.2826927
-0.9323280 -0.9736657
1.1608700 0.0344423

rMarkdown. Evaluating code within markdown text.

Here is some freeform markdown and the first result from an rnorm call is 0.0941479, followed by some more free form text.

rMarkdown: cache

x <- sample(1000,10^4,replace=T)
length(x)
## [1] 10000