Please complete before the next class.

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

## In-Class

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.

# note: for the sake of simplicity we're linking to the file directly on the course site.
# note: this only works for csv files

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.

## R

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.

You can find a video tutorial on Histograms in R here. It duplicates what we did in class and mostly duplicates the notes.

• This is a tedious assignment–you’ll need to work carefully. I suggesting spreading the exercise over several different sessions to give you time to digest the ideas. Don’t rush it. These ideas are not particularly difficult, but they require you to work slowly and carefully.
• I’ve found that working in groups helps when you are stuck.
• I try to write exam questions that student who can do the review exercises will answer correctly and quickly (and that others will answer incorrectly and/or slowly).
• When you can’t get your code to work, it’s usually just a missing parenthesis or quotation mark. It’s not that you’re making a huge mistake. Huamns can sitll mkae snese wehn tehre are tpyos, but not computers! Check your code for typos carefully. Run your script one line at a time, from top to bottom, to find mistakes. As examples, most mistakes are like the following:
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

Carlisle Rainey