#' --- #' title: "My first R notebook" #' author: "Charlotte Wickham **TA**: Myself" #' date: "Sep 28, 2014" #' output: word_document #' --- library(ggplot2) # we'll need this package later #' In a notebook file text after a hash and a single quote (#') is #' interpreted as plain text. # Text after a hash (#) without a quote is interpreted as a code comment. # Anything else is interpreted as R code. R runs the code and inserts any # output into your notebook. # A histogram of a random sample of size 100 from a Normal distribution with # zero mean and variance one. x <- rnorm(100) qplot(x) #' We can do basic formatting in the plain text sections (the ones that start #' with #'). Extra hashes create headings #' #' # A big heading #' ## A smaller heading #' ### An even smaller heading #' #' We can make simple bulleted lists with asterisks #' #' * First item #' * Second item #' #' An even put in a picture (the file image.jpg needs to be in the same folder/directory as this file) #' ![](image.jpg) #' #' I kind of lied to you in the first line of this file. Text after #' is #' actually interpreted as *R Markdown* code not just plain text. This means in #' these sections you can include R output directly, like, #' it is `r difftime(as.Date("2015-12-11"), Sys.Date())` days until the quarter #' ends. You can even put in some math $SE(\overline{x}) = \sigma/ \sqrt{n}$. #' You can find out more about equations [here](http://www.rstudio.com/ide/docs/authoring/using_markdown_equations).