Overview

Consult the general homework guidelines. Though, you still won’t be using a repo in the stat545 github org. This may or may not happen this year! See Make a homework repo below for guidelines on making a repo.

Due anytime Tuesday 2017-09-26. Before class is better, but get help in class or office hours of you need it.

The goal is to explore a new-to-you dataset. In particular, to begin to establish a workflow for data frames or “tibbles”. You will use dplyr and ggplot2 to do some description and visualization.

Your homework should serve as your own personal cheatsheet in the future for things to do with a new dataset. Give yourself the cheatsheet you deserve!

Make a homework repo

We might not be getting you a repo in the stat545 github org. Time will tell! For now, we will make a new GitHub repository that will hold the remainder of your homework submissions (until specified otherwise).

  1. Make a new GitHub repo called STAT545-hw-lastname-firstname. Note:
    • Feel free to just use your Homework 01 repo, and rename it.
    • If you want your homework to be private, here are your options:
      • Request a GitHub student developer pack. It’s free and will allow you to make free GitHub repos.
      • Use Bitbucket. It’s free, gives you free private repos, and works similarly to github. Let me (@vcoia) know via Slack if you’d like to try this.
      • Slack me if neither of these are good. I’ve got another option.
  2. Put your Homework 02 files in a folder that’s obviously named (say, hw02), and link to it in the main README. Be sure to put a README file in the Homework 02 folder as well, describing what’s what in the directory and how someone might navigate the homework submission.

Bring rectangular data in

Work with the gapminder data we explored in class. If you really want to, you can explore a different dataset but get permission from Vincenzo. Message me on Slack – my handle is @vcoia. Self-assess the suitability of your dataset by reading this issue.

The Gapminder data is distributed as an R package from CRAN.

Install it if you have not done so already and remember to load it.

install.packages("gapminder")
library(gapminder)

Install and load dplyr. Probably via the tidyverse meta-package.

install.packages("tidyverse")
library(tidyverse)

Smell test the data

Explore the gapminder object:

  • Is it a data.frame, a matrix, a vector, a list?
  • What’s its class?
  • How many variables/columns?
  • How many rows/observations?
  • Can you get these facts about “extent” or “size” in more than one way? Can you imagine different functions being useful in different contexts?
  • What data type is each variable?

Be sure to justify your answers by calling the appropriate R functions.

Explore individual variables

Pick at least one categorical variable and at least one quantitative variable to explore.

  • What are possible values (or range, whichever is appropriate) of each variable?
  • What values are typical? What’s the spread? What’s the distribution? Etc., tailored to the variable at hand.
  • Feel free to use summary stats, tables, figures. We’re NOT expecting high production value (yet).

Explore various plot types

See the ggplot2 tutorial, which also uses the gapminder data, for ideas.

Make a few plots, probably of the same variable you chose to characterize numerically. Try to explore more than one plot type. Just as an example of what I mean:

  • A scatterplot of two quantitative variables.
  • A plot of one quantitative variable. Maybe a histogram or densityplot or frequency polygon.
  • A plot of one quantitative variable and one categorical. Maybe boxplots for several continents or countries.

You don’t have to use all the data in every plot! It’s fine to filter down to one country or small handful of countries.

Use filter(), select() and %>%

Use filter() to create data subsets that you want to plot.

Practice piping together filter() and select(). Possibly even piping into ggplot().

But I want to do more!

For people who want to take things further.

Evaluate this code and describe the result. Presumably the analyst’s intent was to get the data for Rwanda and Afghanistan. Did they succeed? Why or why not? If not, what is the correct way to do this?

filter(gapminder, country == c("Rwanda", "Afghanistan"))

Read What I do when I get a new data set as told through tweets from SimplyStatistics to get some ideas!

Present numerical tables in a more attractive form, such as using knitr::kable().

Use more of the dplyr functions for operating on a single table.

Adapt exercises from the chapters in the “Explore” section of R for Data Science to the Gapminder dataset.

Report your process

Reflect on what was hard/easy, problems you solved, helpful tutorials you read, etc. What things were hard, even though you saw them in class? What was easy(-ish) even though we haven’t done it in class?

Submit the assignment

As in Homework 01:

  1. Add the teaching team as collaborators, if you haven’t done that already. Their github alias’ are:

vincenzocoia gvdr ksedivyhaley joeybernhardt mynamedaike pgonzaleze derekcho

  1. Write a new issue entitled hw02 ready for grading, and tag the above teaching team. Here’s a convenient string to copy and paste to tag the team:

@vincenzocoia @gvdr @ksedivyhaley @joeybernhardt @mynamedaike @pgonzaleze @derekcho

  1. You’re done!

Rubric

Our general rubric applies, but also …

Check minus: There are some mistakes or omissions, such as the number of rows or variables in the data frame. Or maybe no confirmation of its class or that of the variables inside. There are no plots or there’s just one type of plot (and its probably a scatterplot). There’s no use of filter() or select(). It’s hard to figure out which file I’m supposed to be looking at. Maybe the student forgot to commit and push the figures to GitHub.

Check: Hits all the elements. No obvious mistakes. Pleasant to read. No heroic detective work required. Solid.

Check plus: Some “above and beyond”, creativity, etc. You learned something new from reviewing their work and you’re eager to incorporate it into your work now. Use of dplyr goes beyond filter() and select(). The ggplot2 figures are quite diverse. The repo is very organized and it’s a breeze to find the file for this homework specifically.

Peer Review

The peer review is ready and is due October 2, 2017! Here’s what you’ll need to do:

  1. Find your github username in the table below. If it’s not there, let Vincenzo know! Slack me @vcoia.
  2. Add the people who will be giving you a review as collaborators to the repo containing your homework submission.
  3. Give a review of this homework for the two people you’ve been assigned to. There should be an issue in their repo titled something like hw0x ready for grading – put your review in there as a comment.
    • If there is no such issue, make one! (in their repo)
    • Please don’t mix up your reviewers and reviewees!

Check out the guidelines for giving a peer review.

Your_github Instructions
abishekarun Please add mylinhthibodeau and teilhard1976 as collaborators to your repo containing hw02. Please review the hw02 submission of winnietse1018 and emilymistick.
acavalla Please add mlawre01 and yuanjisun as collaborators to your repo containing hw02. Please review the hw02 submission of susannaelsie and ilgan.
aiod01 Please add swynes and zxkathy as collaborators to your repo containing hw02. Please review the hw02 submission of hsummers and rainerlempert.
Alexander-Morin Please add estennw and sdhanani as collaborators to your repo containing hw02. Please review the hw02 submission of HScheiber and qiaoyuet.
alexrod61 Please add qiaoyuet and auduman as collaborators to your repo containing hw02. Please review the hw02 submission of julianheavyside and Jennica416.
angmelanie Please add hannahdxz and oktokat as collaborators to your repo containing hw02. Please review the hw02 submission of wswade2 and NSKrstic.
arsbar24 Please add peterwhitman and nbendriem as collaborators to your repo containing hw02. Please review the hw02 submission of ZimingY and mattsada.
arthursunbao Please add OliviaTabares and Maria815 as collaborators to your repo containing hw02. Please review the hw02 submission of shadowforti and marbazua.
auduman Please add HScheiber and qiaoyuet as collaborators to your repo containing hw02. Please review the hw02 submission of alexrod61 and julianheavyside.
bcahn7 Please add Kozp and jenncscampbell as collaborators to your repo containing hw02. Please review the hw02 submission of mylinhthibodeau and teilhard1976.
burkeprw Please add Tangjiahui26 and yeonukkim as collaborators to your repo containing hw02. Please review the hw02 submission of Shirlett and OliviaTabares.
CassKon Please add farihakhan and vibudh2209 as collaborators to your repo containing hw02. Please review the hw02 submission of cheungamanda and sepkamal.
ChadFibke Please add NSKrstic and rdwyer2 as collaborators to your repo containing hw02. Please review the hw02 submission of menglinzhou and diermc.
cheungamanda Please add vibudh2209 and CassKon as collaborators to your repo containing hw02. Please review the hw02 submission of sepkamal and cindyhurtado.
cindyhurtado Please add cheungamanda and sepkamal as collaborators to your repo containing hw02. Please review the hw02 submission of juansbr7 and Mathnstein.
danaj191 Please add rainerlempert and yidie as collaborators to your repo containing hw02. Please review the hw02 submission of suminwei2772 and estennw.
diermc Please add ChadFibke and menglinzhou as collaborators to your repo containing hw02. Please review the hw02 submission of gbraich and nicolehawe.
dorawyy Please add emilymistick and yanchaoluo as collaborators to your repo containing hw02. Please review the hw02 submission of k3vzhu and farihakhan.
emilymistick Please add abishekarun and winnietse1018 as collaborators to your repo containing hw02. Please review the hw02 submission of yanchaoluo and dorawyy.
estennw Please add danaj191 and suminwei2772 as collaborators to your repo containing hw02. Please review the hw02 submission of sdhanani and Alexander-Morin.
farihakhan Please add dorawyy and k3vzhu as collaborators to your repo containing hw02. Please review the hw02 submission of vibudh2209 and CassKon.
gbraich Please add menglinzhou and diermc as collaborators to your repo containing hw02. Please review the hw02 submission of nicolehawe and mlawre01.
hannahdxz Please add margotgunning and wenzhengzzz as collaborators to your repo containing hw02. Please review the hw02 submission of oktokat and angmelanie.
HScheiber Please add sdhanani and Alexander-Morin as collaborators to your repo containing hw02. Please review the hw02 submission of qiaoyuet and auduman.
hsmohammed Please add julianheavyside and Jennica416 as collaborators to your repo containing hw02. Please review the hw02 submission of peterwhitman and nbendriem.
hsummers Please add zxkathy and aiod01 as collaborators to your repo containing hw02. Please review the hw02 submission of rainerlempert and yidie.
ilgan Please add acavalla and susannaelsie as collaborators to your repo containing hw02. Please review the hw02 submission of rishadhabib and lucymei.
jenncscampbell Please add navysealtf9k and Kozp as collaborators to your repo containing hw02. Please review the hw02 submission of bcahn7 and mylinhthibodeau.
Jennica416 Please add alexrod61 and julianheavyside as collaborators to your repo containing hw02. Please review the hw02 submission of hsmohammed and peterwhitman.
jmurthy12 Please add shadowforti and marbazua as collaborators to your repo containing hw02. Please review the hw02 submission of xinmiaow and ssheikho.
juansbr7 Please add sepkamal and cindyhurtado as collaborators to your repo containing hw02. Please review the hw02 submission of Mathnstein and swynes.
julianheavyside Please add auduman and alexrod61 as collaborators to your repo containing hw02. Please review the hw02 submission of Jennica416 and hsmohammed.
k3vzhu Please add yanchaoluo and dorawyy as collaborators to your repo containing hw02. Please review the hw02 submission of farihakhan and vibudh2209.
KateJohnson Please add santiagodr and vmichalowski as collaborators to your repo containing hw02. Please review the hw02 submission of navysealtf9k and Kozp.
Kozp Please add KateJohnson and navysealtf9k as collaborators to your repo containing hw02. Please review the hw02 submission of jenncscampbell and bcahn7.
lucymei Please add ilgan and rishadhabib as collaborators to your repo containing hw02. Please review the hw02 submission of santiagodr and vmichalowski.
marbazua Please add arthursunbao and shadowforti as collaborators to your repo containing hw02. Please review the hw02 submission of jmurthy12 and xinmiaow.
margotgunning Please add ssheikho and xinyaofan as collaborators to your repo containing hw02. Please review the hw02 submission of wenzhengzzz and hannahdxz.
Maria815 Please add Shirlett and OliviaTabares as collaborators to your repo containing hw02. Please review the hw02 submission of arthursunbao and shadowforti.
Mathnstein Please add cindyhurtado and juansbr7 as collaborators to your repo containing hw02. Please review the hw02 submission of swynes and zxkathy.
mattsada Please add arsbar24 and ZimingY as collaborators to your repo containing hw02. Please review the hw02 submission of vanflad and SonjaS1.
menglinzhou Please add rdwyer2 and ChadFibke as collaborators to your repo containing hw02. Please review the hw02 submission of diermc and gbraich.
mlawre01 Please add gbraich and nicolehawe as collaborators to your repo containing hw02. Please review the hw02 submission of yuanjisun and acavalla.
mylinhthibodeau Please add jenncscampbell and bcahn7 as collaborators to your repo containing hw02. Please review the hw02 submission of teilhard1976 and abishekarun.
navysealtf9k Please add vmichalowski and KateJohnson as collaborators to your repo containing hw02. Please review the hw02 submission of Kozp and jenncscampbell.
nbendriem Please add hsmohammed and peterwhitman as collaborators to your repo containing hw02. Please review the hw02 submission of arsbar24 and ZimingY.
nicolehawe Please add diermc and gbraich as collaborators to your repo containing hw02. Please review the hw02 submission of mlawre01 and yuanjisun.
NSKrstic Please add angmelanie and wswade2 as collaborators to your repo containing hw02. Please review the hw02 submission of rdwyer2 and ChadFibke.
oktokat Please add wenzhengzzz and hannahdxz as collaborators to your repo containing hw02. Please review the hw02 submission of angmelanie and wswade2.
OliviaTabares Please add burkeprw and Shirlett as collaborators to your repo containing hw02. Please review the hw02 submission of Maria815 and arthursunbao.
peterwhitman Please add Jennica416 and hsmohammed as collaborators to your repo containing hw02. Please review the hw02 submission of nbendriem and arsbar24.
qiaoyuet Please add Alexander-Morin and HScheiber as collaborators to your repo containing hw02. Please review the hw02 submission of auduman and alexrod61.
rainerlempert Please add aiod01 and hsummers as collaborators to your repo containing hw02. Please review the hw02 submission of yidie and danaj191.
rdwyer2 Please add wswade2 and NSKrstic as collaborators to your repo containing hw02. Please review the hw02 submission of ChadFibke and menglinzhou.
rishadhabib Please add susannaelsie and ilgan as collaborators to your repo containing hw02. Please review the hw02 submission of lucymei and santiagodr.
santiagodr Please add rishadhabib and lucymei as collaborators to your repo containing hw02. Please review the hw02 submission of vmichalowski and KateJohnson.
sdhanani Please add suminwei2772 and estennw as collaborators to your repo containing hw02. Please review the hw02 submission of Alexander-Morin and HScheiber.
sepkamal Please add CassKon and cheungamanda as collaborators to your repo containing hw02. Please review the hw02 submission of cindyhurtado and juansbr7.
shadowforti Please add Maria815 and arthursunbao as collaborators to your repo containing hw02. Please review the hw02 submission of marbazua and jmurthy12.
Shirlett Please add yeonukkim and burkeprw as collaborators to your repo containing hw02. Please review the hw02 submission of OliviaTabares and Maria815.
SonjaS1 Please add mattsada and vanflad as collaborators to your repo containing hw02. Please review the hw02 submission of Tangjiahui26 and yeonukkim.
ssheikho Please add jmurthy12 and xinmiaow as collaborators to your repo containing hw02. Please review the hw02 submission of xinyaofan and margotgunning.
suminwei2772 Please add yidie and danaj191 as collaborators to your repo containing hw02. Please review the hw02 submission of estennw and sdhanani.
susannaelsie Please add yuanjisun and acavalla as collaborators to your repo containing hw02. Please review the hw02 submission of ilgan and rishadhabib.
swynes Please add juansbr7 and Mathnstein as collaborators to your repo containing hw02. Please review the hw02 submission of zxkathy and aiod01.
Tangjiahui26 Please add vanflad and SonjaS1 as collaborators to your repo containing hw02. Please review the hw02 submission of yeonukkim and burkeprw.
teilhard1976 Please add bcahn7 and mylinhthibodeau as collaborators to your repo containing hw02. Please review the hw02 submission of abishekarun and winnietse1018.
vanflad Please add ZimingY and mattsada as collaborators to your repo containing hw02. Please review the hw02 submission of SonjaS1 and Tangjiahui26.
vibudh2209 Please add k3vzhu and farihakhan as collaborators to your repo containing hw02. Please review the hw02 submission of CassKon and cheungamanda.
vmichalowski Please add lucymei and santiagodr as collaborators to your repo containing hw02. Please review the hw02 submission of KateJohnson and navysealtf9k.
wenzhengzzz Please add xinyaofan and margotgunning as collaborators to your repo containing hw02. Please review the hw02 submission of hannahdxz and oktokat.
winnietse1018 Please add teilhard1976 and abishekarun as collaborators to your repo containing hw02. Please review the hw02 submission of emilymistick and yanchaoluo.
wswade2 Please add oktokat and angmelanie as collaborators to your repo containing hw02. Please review the hw02 submission of NSKrstic and rdwyer2.
xinmiaow Please add marbazua and jmurthy12 as collaborators to your repo containing hw02. Please review the hw02 submission of ssheikho and xinyaofan.
xinyaofan Please add xinmiaow and ssheikho as collaborators to your repo containing hw02. Please review the hw02 submission of margotgunning and wenzhengzzz.
yanchaoluo Please add winnietse1018 and emilymistick as collaborators to your repo containing hw02. Please review the hw02 submission of dorawyy and k3vzhu.
yeonukkim Please add SonjaS1 and Tangjiahui26 as collaborators to your repo containing hw02. Please review the hw02 submission of burkeprw and Shirlett.
yidie Please add hsummers and rainerlempert as collaborators to your repo containing hw02. Please review the hw02 submission of danaj191 and suminwei2772.
yuanjisun Please add nicolehawe and mlawre01 as collaborators to your repo containing hw02. Please review the hw02 submission of acavalla and susannaelsie.
ZimingY Please add nbendriem and arsbar24 as collaborators to your repo containing hw02. Please review the hw02 submission of mattsada and vanflad.
zxkathy Please add Mathnstein and swynes as collaborators to your repo containing hw02. Please review the hw02 submission of aiod01 and hsummers.