Overview

Consult the general homework guidelines.

Due anytime Friday 2017-10-20.

Goals:

Remember the sampler concept. Your homework should serve as your own personal cheatsheet in the future for canonical tasks. Make things nice – your future self will thank you!

Gapminder, Singer, … or something else

You can work with the gapminder data or take this chance to play with something else, such as Joey’s Singer. In which case, you’ll have to create comparable tasks for yourself.

Factor management

Step goals:

I give here the trace for both the Singer and the Gapminder dataframes.

Singer version:

Factorise. Transform some of the variable in the singer_locations dataframe into factors: pay attention at what levels you introduce and their order. Try and consider the difference between the base R as.factor and the forcats-provided functions.

Drop 0. Filter the singer_locations data to remove observations associated with the uncorrectly inputed year 0. Additionally, remove unused factor levels. Provide concrete information on the data before and after removing these rows and levels; address the number of rows and the levels of the affected factors.

Reorder the levels of year, artist_name or title. Use the forcats package to change the order of the factor levels, based on a principled summary of one of the quantitative variables. Consider experimenting with a summary statistic beyond the most basic choice of the median.

Gapminder version:

Drop Oceania. Filter the Gapminder data to remove observations associated with the continent of Oceania. Additionally, remove unused factor levels. Provide concrete information on the data before and after removing these rows and Oceania; address the number of rows and the levels of the affected factors.

Reorder the levels of country or continent. Use the forcats package to change the order of the factor levels, based on a principled summary of one of the quantitative variables. Consider experimenting with a summary statistic beyond the most basic choice of the median.

Common part:

While you’re here, practice writing to file and reading back in (see next section).

Characterize the (derived) data before and after your factor re-leveling.

  • Explore the effects of arrange(). Does merely arranging the data have any effect on, say, a figure?
  • Explore the effects of reordering a factor and factor reordering coupled with arrange(). Especially, what effect does this have on a figure?

These explorations should involve the data, the factor levels, and some figures.

File I/O

Experiment with one or more of write_csv()/read_csv() (and/or TSV friends), saveRDS()/readRDS(), dput()/dget(). Create something new, probably by filtering or grouped-summarization of Singer or Gapminder. I highly recommend you fiddle with the factor levels, i.e. make them non-alphabetical (see previous section). Explore whether this survives the round trip of writing to file then reading back in.

Visualization design

Remake at least one figure or create a new one, in light of something you learned in the recent class meetings about visualization design and color. Maybe juxtapose your first attempt and what you obtained after some time spent working on it. Reflect on the differences. If using Gapminder, you can use the country or continent color scheme that ships with Gapminder. Consult the guest lecture from Tamara Munzner and everything here.

Writing figures to file

Use ggsave() to explicitly save a plot to file. Then use ![Alt text](/path/to/img.png) to load and embed it in your report. You can play around with various options, such as:

Clean up your repo!

You have 6 weeks of R Markdown and GitHub experience now. You’ve reviewed 4 peer assignments. Surely there are aspects of your current repo organization that could be better. Deal with that. Ideas:

But I want to do more!

Make a deeper exploration of the forcats packages, i.e. try more of the factor level reordering functions.

Revalue a factor, e.g.:

When you get tired, if you still have time on your hand, try to make this process of geolocalization more streamlined: you may want to try and use the separate function from tidyr.

Report your process

You’re encouraged to reflect on what was hard/easy, problems you solved, helpful tutorials you read, etc. Give credit to your sources, whether it’s a blog post, a fellow student, an online tutorial, etc.

Submit the assignment

It’s always the same: add the teaching stuff as collabs, open the issue, you are done.

Rubric

Check minus: One or more elements are missing or sketchy. Missed opportunities to complement code and numbers with a figure and interpretation. Technical problem that is relatively easy to fix. It’s hard to find the report in this crazy repo.

Check: Hits all the elements. No obvious mistakes. Pleasant to read. No heroic detective work required. Well done! This should be the most typical mark!

Check plus: Exceeded the requirements in number of dimensions. Developed novel tasks that were indeed interesting and “worked”. Impressive use of R – maybe involving functions, packages or workflows that weren’t given in class materials. Impeccable organization of repo and report. You learned something new from reviewing their work and you’re eager to incorporate it into your work.

Peer Review

The peer review is ready and is due October 25, 2017 (before midnight)! Here’s what you’ll need to do:

  1. Find your github username in the table below. If it’s not there, let Giulio know! Slack me @giulio.
  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 ssheikho and santiagodr as collaborators to your repo containing hw05. Please review the hw05 submission of rdwyer2 and Maria815.
acavalla Please add Maria815 and emilymistick as collaborators to your repo containing hw05. Please review the hw05 submission of cheungamanda and lucymei.
aiod01 Please add jmurthy12 and sdhanani as collaborators to your repo containing hw05. Please review the hw05 submission of k3vzhu and ilgan.
Alexander-Morin Please add danaj191 and arsbar24 as collaborators to your repo containing hw05. Please review the hw05 submission of juansbr7 and wenzhengzzz.
alexrod61 Please add xinmiaow and CassKon as collaborators to your repo containing hw05. Please review the hw05 submission of yidie and ZimingY.
angmelanie Please add ZimingY and cindyhurtado as collaborators to your repo containing hw05. Please review the hw05 submission of nbendriem and burkeprw.
arsbar24 Please add Tangjiahui26 and danaj191 as collaborators to your repo containing hw05. Please review the hw05 submission of Alexander-Morin and juansbr7.
arthursunbao Please add estennw and shadowforti as collaborators to your repo containing hw05. Please review the hw05 submission of ChadFibke and KateJohnson.
auduman Please add yeonukkim and vibudh2209 as collaborators to your repo containing hw05. Please review the hw05 submission of Mathnstein and vanflad.
bcahn7 Please add qiaoyuet and susannaelsie as collaborators to your repo containing hw05. Please review the hw05 submission of yuanjisun and dorawyy.
burkeprw Please add angmelanie and nbendriem as collaborators to your repo containing hw05. Please review the hw05 submission of winnietse1018 and SonjaS1.
CassKon Please add mylinhthibodeau and xinmiaow as collaborators to your repo containing hw05. Please review the hw05 submission of alexrod61 and yidie.
ChadFibke Please add shadowforti and arthursunbao as collaborators to your repo containing hw05. Please review the hw05 submission of KateJohnson and wswade2.
cheungamanda Please add emilymistick and acavalla as collaborators to your repo containing hw05. Please review the hw05 submission of lucymei and nicolehawe.
cindyhurtado Please add yidie and ZimingY as collaborators to your repo containing hw05. Please review the hw05 submission of angmelanie and nbendriem.
danaj191 Please add vmichalowski and Tangjiahui26 as collaborators to your repo containing hw05. Please review the hw05 submission of arsbar24 and Alexander-Morin.
diermc Please add lucymei and nicolehawe as collaborators to your repo containing hw05. Please review the hw05 submission of zxkathy and Jennica416.
dorawyy Please add bcahn7 and yuanjisun as collaborators to your repo containing hw05. Please review the hw05 submission of hsmohammed and ssheikho.
emilymistick Please add rdwyer2 and Maria815 as collaborators to your repo containing hw05. Please review the hw05 submission of acavalla and cheungamanda.
estennw Please add mlawre01 and heathersummers as collaborators to your repo containing hw05. Please review the hw05 submission of shadowforti and arthursunbao.
farihakhan Please add Jennica416 and Shirlett as collaborators to your repo containing hw05. Please review the hw05 submission of margotgunning and swynes.
gbraich Please add oktokat and marbazua as collaborators to your repo containing hw05. Please review the hw05 submission of rainerlempert and hannahdxz.
hannahdxz Please add gbraich and rainerlempert as collaborators to your repo containing hw05. Please review the hw05 submission of julianheavyside and mattsada.
heathersummers Please add HScheiber and mlawre01 as collaborators to your repo containing hw05. Please review the hw05 submission of estennw and shadowforti.
HScheiber Please add julianheavyside and mattsada as collaborators to your repo containing hw05. Please review the hw05 submission of mlawre01 and heathersummers.
hsmohammed Please add yuanjisun and dorawyy as collaborators to your repo containing hw05. Please review the hw05 submission of ssheikho and santiagodr.
ilgan Please add aiod01 and k3vzhu as collaborators to your repo containing hw05. Please review the hw05 submission of teilhard1976 and OliviaTabares.
jenncscampbell Please add KateJohnson and wswade2 as collaborators to your repo containing hw05. Please review the hw05 submission of yanchaoluo and mylinhthibodeau.
Jennica416 Please add diermc and zxkathy as collaborators to your repo containing hw05. Please review the hw05 submission of Shirlett and farihakhan.
jmurthy12 Please add sepkamal and navysealtf9k as collaborators to your repo containing hw05. Please review the hw05 submission of sdhanani and aiod01.
juansbr7 Please add arsbar24 and Alexander-Morin as collaborators to your repo containing hw05. Please review the hw05 submission of wenzhengzzz and menglinzhou.
julianheavyside Please add rainerlempert and hannahdxz as collaborators to your repo containing hw05. Please review the hw05 submission of mattsada and HScheiber.
k3vzhu Please add sdhanani and aiod01 as collaborators to your repo containing hw05. Please review the hw05 submission of ilgan and teilhard1976.
KateJohnson Please add arthursunbao and ChadFibke as collaborators to your repo containing hw05. Please review the hw05 submission of wswade2 and jenncscampbell.
Kozp Please add OliviaTabares and suminwei2772 as collaborators to your repo containing hw05. Please review the hw05 submission of xinyaofan and qiaoyuet.
lucymei Please add acavalla and cheungamanda as collaborators to your repo containing hw05. Please review the hw05 submission of nicolehawe and diermc.
marbazua Please add vanflad and oktokat as collaborators to your repo containing hw05. Please review the hw05 submission of gbraich and rainerlempert.
margotgunning Please add Shirlett and farihakhan as collaborators to your repo containing hw05. Please review the hw05 submission of swynes and rishadhabib.
Maria815 Please add abishekarun and rdwyer2 as collaborators to your repo containing hw05. Please review the hw05 submission of emilymistick and acavalla.
Mathnstein Please add vibudh2209 and auduman as collaborators to your repo containing hw05. Please review the hw05 submission of vanflad and oktokat.
mattsada Please add hannahdxz and julianheavyside as collaborators to your repo containing hw05. Please review the hw05 submission of HScheiber and mlawre01.
menglinzhou Please add juansbr7 and wenzhengzzz as collaborators to your repo containing hw05. Please review the hw05 submission of NSKrstic and sepkamal.
mlawre01 Please add mattsada and HScheiber as collaborators to your repo containing hw05. Please review the hw05 submission of heathersummers and estennw.
mylinhthibodeau Please add jenncscampbell and yanchaoluo as collaborators to your repo containing hw05. Please review the hw05 submission of xinmiaow and CassKon.
navysealtf9k Please add NSKrstic and sepkamal as collaborators to your repo containing hw05. Please review the hw05 submission of jmurthy12 and sdhanani.
nbendriem Please add cindyhurtado and angmelanie as collaborators to your repo containing hw05. Please review the hw05 submission of burkeprw and winnietse1018.
nicolehawe Please add cheungamanda and lucymei as collaborators to your repo containing hw05. Please review the hw05 submission of diermc and zxkathy.
NSKrstic Please add wenzhengzzz and menglinzhou as collaborators to your repo containing hw05. Please review the hw05 submission of sepkamal and navysealtf9k.
oktokat Please add Mathnstein and vanflad as collaborators to your repo containing hw05. Please review the hw05 submission of marbazua and gbraich.
OliviaTabares Please add ilgan and teilhard1976 as collaborators to your repo containing hw05. Please review the hw05 submission of suminwei2772 and Kozp.
peterwhitman Please add winnietse1018 and SonjaS1 as collaborators to your repo containing hw05. Please review the hw05 submission of vmichalowski and Tangjiahui26.
qiaoyuet Please add Kozp and xinyaofan as collaborators to your repo containing hw05. Please review the hw05 submission of susannaelsie and bcahn7.
rainerlempert Please add marbazua and gbraich as collaborators to your repo containing hw05. Please review the hw05 submission of hannahdxz and julianheavyside.
rdwyer2 Please add santiagodr and abishekarun as collaborators to your repo containing hw05. Please review the hw05 submission of Maria815 and emilymistick.
rishadhabib Please add margotgunning and swynes as collaborators to your repo containing hw05. Please review the hw05 submission of yeonukkim and vibudh2209.
santiagodr Please add hsmohammed and ssheikho as collaborators to your repo containing hw05. Please review the hw05 submission of abishekarun and rdwyer2.
sdhanani Please add navysealtf9k and jmurthy12 as collaborators to your repo containing hw05. Please review the hw05 submission of aiod01 and k3vzhu.
sepkamal Please add menglinzhou and NSKrstic as collaborators to your repo containing hw05. Please review the hw05 submission of navysealtf9k and jmurthy12.
shadowforti Please add heathersummers and estennw as collaborators to your repo containing hw05. Please review the hw05 submission of arthursunbao and ChadFibke.
Shirlett Please add zxkathy and Jennica416 as collaborators to your repo containing hw05. Please review the hw05 submission of farihakhan and margotgunning.
SonjaS1 Please add burkeprw and winnietse1018 as collaborators to your repo containing hw05. Please review the hw05 submission of peterwhitman and vmichalowski.
ssheikho Please add dorawyy and hsmohammed as collaborators to your repo containing hw05. Please review the hw05 submission of santiagodr and abishekarun.
suminwei2772 Please add teilhard1976 and OliviaTabares as collaborators to your repo containing hw05. Please review the hw05 submission of Kozp and xinyaofan.
susannaelsie Please add xinyaofan and qiaoyuet as collaborators to your repo containing hw05. Please review the hw05 submission of bcahn7 and yuanjisun.
swynes Please add farihakhan and margotgunning as collaborators to your repo containing hw05. Please review the hw05 submission of rishadhabib and yeonukkim.
Tangjiahui26 Please add peterwhitman and vmichalowski as collaborators to your repo containing hw05. Please review the hw05 submission of danaj191 and arsbar24.
teilhard1976 Please add k3vzhu and ilgan as collaborators to your repo containing hw05. Please review the hw05 submission of OliviaTabares and suminwei2772.
vanflad Please add auduman and Mathnstein as collaborators to your repo containing hw05. Please review the hw05 submission of oktokat and marbazua.
vibudh2209 Please add rishadhabib and yeonukkim as collaborators to your repo containing hw05. Please review the hw05 submission of auduman and Mathnstein.
vmichalowski Please add SonjaS1 and peterwhitman as collaborators to your repo containing hw05. Please review the hw05 submission of Tangjiahui26 and danaj191.
wenzhengzzz Please add Alexander-Morin and juansbr7 as collaborators to your repo containing hw05. Please review the hw05 submission of menglinzhou and NSKrstic.
winnietse1018 Please add nbendriem and burkeprw as collaborators to your repo containing hw05. Please review the hw05 submission of SonjaS1 and peterwhitman.
wswade2 Please add ChadFibke and KateJohnson as collaborators to your repo containing hw05. Please review the hw05 submission of jenncscampbell and yanchaoluo.
xinmiaow Please add yanchaoluo and mylinhthibodeau as collaborators to your repo containing hw05. Please review the hw05 submission of CassKon and alexrod61.
xinyaofan Please add suminwei2772 and Kozp as collaborators to your repo containing hw05. Please review the hw05 submission of qiaoyuet and susannaelsie.
yanchaoluo Please add wswade2 and jenncscampbell as collaborators to your repo containing hw05. Please review the hw05 submission of mylinhthibodeau and xinmiaow.
yeonukkim Please add swynes and rishadhabib as collaborators to your repo containing hw05. Please review the hw05 submission of vibudh2209 and auduman.
yidie Please add CassKon and alexrod61 as collaborators to your repo containing hw05. Please review the hw05 submission of ZimingY and cindyhurtado.
yuanjisun Please add susannaelsie and bcahn7 as collaborators to your repo containing hw05. Please review the hw05 submission of dorawyy and hsmohammed.
ZimingY Please add alexrod61 and yidie as collaborators to your repo containing hw05. Please review the hw05 submission of cindyhurtado and angmelanie.
zxkathy Please add nicolehawe and diermc as collaborators to your repo containing hw05. Please review the hw05 submission of Jennica416 and Shirlett.