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.1656112 -0.3634441 -0.8308876  0.5068964  1.2481014 -1.4238921
##  [7]  2.1132631 -0.6885769 -0.5000336 -0.6300609

rMarkdown. Inserting tables.

library(knitr)
temp <- rnorm(10)
temp2 <- rnorm(10)
dfExample <- cbind(temp,temp2)
kable(dfExample)
temp temp2
0.4532997 -2.5092258
-0.8486485 -1.5360402
-0.0615886 -0.4530960
-0.0964142 -0.2813974
-1.8918582 1.4864986
1.2246781 -0.0991920
0.8085905 -1.5599559
-2.2456083 -2.2594701
1.8381430 -1.2462836
1.0358540 -1.9636367

rMarkdown. Evaluating code within markdown text.

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

rMarkdown: cache

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