require(mosaic) # Load additional packages here knitr::opts_chunk$set( tidy=FALSE, # display code as typed size="small") # slightly smaller font for code
Text can be decorated with bold or italics. It is also possible to
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.
If the code of an R chunk produces a plot, this plot can be displayed in the resulting file.
gf_point(births ~ date, data = Births78)
Other forms of R output are also displayed as they are produced.
favstats(~ births, data = Births78)
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.
It's useful to record some information about how your file was created.
r Sys.Date()
r R.version.string
r getRversion()
mosaic
package version: r packageVersion("mosaic")
sessionInfo() # could use devtools::session_info() if you prefer that
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.