Please complete before the next class.

Make sure that you’ve completed all previous HW first.

Exam 1 Announcement

We’ll have Exam 1 in Diffenbaugh 128–not in our usual classroom. This is a 170 person lecture hall, so the 65 of us can spread out a bit. If you’re still uncomfortable in that space, reach out. I have an alternative plan.

As always, if you’re feeling ill, stay home. I’ll allow you to make up the exam without penalty at a later time.

You should bring a pencil and your calculator; I will bring the scantron forms.


Here’s my outline for the class and code to load the data. See the finished product link below.

# load packages
library(tidyverse) # load tidyverse package, which has lots of useful functions.

# load data
nominate_df <- read_csv("")
# note: for the sake of simplicity we're linking to the file directly on the course site.
# note: this only works for csv files
# feel free to download it, add it to the RStudio Cloud project, and use read_csv("nominate.csv").

glimpse(nominate_df) # use glimpse() to see what your data frame looks like.

# histograms
# ----

# filtering
# ----

# faceting
# ----

# density plots
# ----

# color, fill, and alpha
# ----

# labels
# ----

# themes
# ----

Here’s the cloud project with the finished code histograms.R we wrote in class. The servers have been a little fragile in the past if lots of people tried to access this at once, so you might try later if you run into an error of some sort.


See the previous HW if you haven’t got RStudio working on your computer yet.

Read and review your notes and my notes over “Histograms in R” (currently chapter 3). Answer the review questions thoughout the document. I highlighted the exercises in orange to make them easy to spot.

As before, I give the following advice about the R assignments:

b <- c("Male", "Female)  # missing the second " after "Female"
exp(23  # forgot to close a parentheses
log(10 base = 2)  # missing comma between arguments

a <- c(1, 2, 3)
mean(A)  # R is case-sensitive--there's an object "a", but no object "A" 
mena(a)  # misspelled function name
Mean(a)  # R is case-senstive

Prepare for the Exam

You should bring a pencil and your calculator.

You are responsible for remembering your calculator. You will need it. If you forget, then you will be without a calculator. I cannot provide backups for the whole class, so I’ll not provide backups for anyone.

I will bring the scantron forms.

When studying for the exam, just make sure you can handle the review exercises. If you can do the review exercises, then you have learned what I wanted and will do well on the exam. You should be able to do the conceptual exercises “closed-book.” If you can do the R exercises successfully while relying on the notes “somewhat”, then you’re well-prepared for the exam.

When I write the exam, I just pick a representative set of review exercises use those to inspire multiple choice questions. Some exam questions will be nearly identical to the review exercises. But if you can complete the review exercises, you can answer the exam questions.

The exam covers everything, including drawing histograms with ggplot2 in R. Look back through each HW and make sure you’ve completed all the review exercises (spread across slides, FPP chs. 1-3, and notes).

Creative Commons License
Carlisle Rainey