Include the following R code chunk at the beginning of your R Markdown documents so that all of the commands associated with our textbook are available to use.
library(fastR2)
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. I recommend that you generate an HTML file when you Knit. Once the preview of the HTML file opens, click on “Open in Browswer” so that you can access printing functionality.
Note that when you click the Knit button, R only looks within your R Markdown document for data and commands; anything that you’ve done at the console is not available. In particular, this means that you must include commands to import data sets within the R Markdown file.
If you go to the Help menu and then select “R Markdown Quick Reference”, you will find a list of common formats you can create in an R Markdown document. In particular, note that you can include LaTeX commands like \(\frac{1}{2}\) within an R Markdown document.
library(fastR2)
classSurvey=read.csv("C:/Users/M/Downloads/ClassSurveyResults.csv", header=T, na.strings="?")
histogram(~classSurvey$Work | classSurvey$Sport)