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] -0.6173846 -0.9283234  0.5935517 -1.0120634  0.5025625  1.6514743
##  [7]  0.2104179  0.2130598  0.6040899 -0.1486524

##rMarkdown. Inserting tables.

library(knitr)
temp <- rnorm(10)
temp2 <- rnorm(10)
dfExample <- cbind(temp,temp2)
kable(dfExample)
temp temp2
1.7630155 0.1698394
1.0086150 0.2478644
-0.8819647 0.9126439
-0.3232579 0.4715398
-0.2035664 1.1341530
0.8939340 0.4875325
-0.6714320 1.0935822
0.3644899 -0.2517670
-0.2827701 0.2786603
0.0083510 -0.0228387

##rMarkdown. Evaluating code within markdown text.

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

##rMarkdown: cache

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