Source file ⇒ stat184Template.Rmd
In Markdown, you type ordinary text like this, that will be turned into an ordinary paragraph. Always keep the boilerplate stuff up above, it’s where you can load packages (i.e. add-ons) that R will need as well as embed a copy of your Markdown document into the html output. In fact, you can click that link to get the Markdown file that made this and use it as a template!
Here’s a second paragraph. This one has a word in italics and another word in bold. Markdown can do lots of cool things, and the RStudio folks created a very handy cheat sheet that you can find linked here. By the way, that’s how you embed a link.
A numbered list follows. You need a blank line before the list starts or it won’t work:
Here’s an unordered list:
You can do calculations easily
sqrt(100)
## [1] 10
Not only does Markdown make documents look pretty nice, any R code refreshes every time you compile the document, so if something changes the document automatically updates (this is pretty much the best part).
Here’s the date when I last compiled this:
date()
## [1] "Tue Sep 6 15:30:13 2016"
That’s a trivial example, but if you want to reuse some analysis for a different data set or link your analysis to some live data source on the web that updates everyday it’s a big deal.
It’s easy to just embed an image from a local file on your computer, or something from the web: