Announcements

Group warm-up

Discuss the following with others at your table. Go around so everyone responds to each question. Try to clear up the muddiest points, or bring it up to discuss as a class.

Infrastructure

Installation (do this before next class)

  1. RStudio: install R from www.r-project.org and RStudio Desktop (free version) from rstudio.com
  2. Check for packages: devtools, ggplot2, dplyr, DCF (from Github), mosaicData, NHANES, DCFinteractive, mosaic, knitr, rmarkdown, rpart, shiny, manipulate.
  3. Here’s a script from the textbook author that you can run to install these packages manually.

RStudio Tour

  • Windows, panes, and tabs in RStudio.
  • Markdown / RMarkdown
    • Opening an Rmd file for editing.
    • Saving Rmd files
    • Compiling Rmd to HTML (or PDF or MS Word)
  • Handing in files for class
    • Upload HTML files to Canvas using DCF template in RMarkdown unless otherwise instructed.
    • Template includes a few boilerplate commands to embed your Rmd code in the HTML document.

Creating an Rmd File

Use the “DCF Work” or “DataComputing simple” template file for Rmd:

  • In RStudio: File >> New File >> R Markdown >> From Template >> DCF Work
  • Eventually, you will upload your HTML file to Canvas (with embedded .Rmd file)

Markdown for …

  • Headings, lists, mathematics
  • Links, images
  • R code chunks

The good people at RStudio have developed a number of “Cheat Sheets” to get people off and running with these tools. Here’s a link to several of them, including RMarkdown, RStudio, and other topics we’ll hit in this course.

Using RMarkdown to develop the STAT 184 website

Using RMarkdown to develop the STAT 184 website


Tidy Data

Basics: Cases, Variables, rows, columns, quantitative, categorical

Exercises: Put these into tidy form.

You’re going to work in groups to put two different data sets (HeightMeasurements & ArmedForcesMaritalStatus) into tidy form. Each group will put their results into a Google Sheets document:

Instructions:

  • Work on the spreadsheets together with your group.
  • Sketch things out together on a white board before you do anything in the computer.
  • Make a separate tab for each table.
  • Use Solstice to mirror your work to the front screen (one per group).
  • Hand your work as a group on Canvas. If you aren’t able to finish in class, you can finalize things and upload it by tomorrow night.

Height measurements data

In the 1880s, Francis Galton started to make a mathematical theory of evolution.

Here’s part of a page from his lab notebook.

A page from Francis Galton’s notebook.

A page from Francis Galton’s notebook.

Marital status in the US armed forces

Here’s the original neat, compact, yet untidy spreadsheet.

Sketch out the whole thing, but you may restrict the final product to include only the single warrant officers if you wish. (tip: utilize the capabilities of google sheets to divide and conquor!)

The homework for next week (see course webpage)


teaching | stat 184 home | syllabus | piazza | canvas