library(learnr) # the tutorial package library(statPREP) # some things Danny put together for StatPREP library(tibble) # for dealing with tibble data library(ggformula) # all those gf_functions live hear library(mosaicData) # mosaic data sets library(mosaic) # Project MOSAIC tools theme_set(theme_bw()) # get rid of the gray background in the plots # A few options for how R stuff is displayed knitr::opts_chunk$set( echo = TRUE, # show R code in non-exercise chunks fig.align = "center", # center plots on the page fig.width = 6, fig.height = 2.5 # default figure size )
2nd level headers (##
) introduce the titles of the topics. Be sure to leave a space after ##
.
You can type any text you like. If you want to emaphsize something, you can use bold or italics.
To find out about all the markup options, see the R Markdown Cheat Sheet that RStudio provides or the Markdown.Quick Reference in the Help menu.
To create an exercise, add exercise = TRUE
to the chunk header. Make sure the chunk
has a label. (Here we use example-exercise
for the label.)
gf_point(height ~ mother, data = Galton)
This code will be run without the user having to click on "Run Code". Note the each exercise must have a unique label.
gf_point(height ~ mother, data = Galton)
Replace goal
with one of the plotting functions.
goal(height ~ mother, data = Galton)
This is sub-topic 1.
More stuff can go here.
This is sub-topic 2.
That's all there is to this.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.