RMarkdown Example Using Galton Data

Text

Text can be decorated with bold or italics. It is also possible to

  • create links
  • include mathematics like \(e=mc^2\) or \[y = \beta_0 + \beta_1 x_1 + \beta_2 x_2\]

Be sure to put a space after the * when you are creating bullets and a space after # when creating section headers, but not between $ and the mathematical formulas.

Scatterplot of Heights of Sons by Heights of Fathers

If the code of an R chunk produces a plot, this plot can be displayed in the resulting file.

ggplot(data=Galton,aes(x=father,y=height))+geom_point() + stat_smooth(method=lm) 

R output

Other forms of R output are also displayed as they are produced.

favstats(father,data=Galton)
##  min Q1 median Q3  max     mean       sd   n missing
##   62 68     69 71 78.5 69.23285 2.470256 898       0

Destination formats

This file can be knit to HTML, PDF, or Word. In RStudio, just select the desired output file type and click on Knit HTML, Knit PDF, or Knit Word. Use the dropdown menu next to that to change the desired file type.