Files with extension .Rmd are RMarkdown files. We are going to practice compiling .Rmd files, i.e. knit them, to PDF files and to HTML pages.

  1. When you save this .Rmd file to your filespace, rename it to HW0-RMarkdown-yourlastname.Rmd.
  2. Open the .Rmd file in RStudio, then change the name of the author to yours and also change the date.
  3. Click on the arrow next to the “Knit” button above and select “Knit to PDF”
  4. Click on the arrow next to the “Knit” button above and select “Knit to HTML”
  5. In the resulting pop-up window of an HTML page, click on “Publish” (in blue on the top-right) -> RPubs -> Publish. Give it a title and a “slug” i.e. URL completion. (You will need to create an account.) Your analysis is now online! You can update what’s online by repeating steps 4 and 5.
  6. Copy the URL of the resulting RPubs page.
  7. Change the following URL to the URL of your RPubs page: http://rpubs.com/schutzd1/HW2
  8. Indicate how much time you spent on this assignment up to now:About 10-15 minutes.
  9. Re-knit this document to HTML and update what’s on RPubs.
  10. Finally, submit this file only, HW0-RMarkdown-yourlastname.Rmd, to our shared Google homework submission folder.

Examples

We’ll learn R Markdown syntax as we go during the semester.

data(mtcars)
plot(mtcars$mpg, mtcars$disp)

See how we can seamlessly blend R code, R output, R plots, and text!

summary(mtcars$wt)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   1.513   2.581   3.325   3.217   3.610   5.424

blah blah

More Stuff

Quick lists:

  • Hello world
  • My name is Russ
    • Make sublists
    • Yeah

Quick numbered lists:

  1. Steelers
  2. Everyone else
  3. Packers

LaTeX

\(\sin{\left(17x+e^{0.654}+\frac{1}{2}\right)}\)

Tables:

First Header Second Header
Content Cell Content Cell
Content Cell Content Cell