## Add a Directory HW5

Add a directory HW5 to your repository. This is where you will put the rest of your work for this assignment.

Be sure to commit and push your changes.

## 1. Gapminder Tooltips

The ggplotly function in the plotly package allows you to add tooltips to points in a plot created with ggplot2. Use this approach to add tooltips showing coutnry name to the plots of life expectancy against for four years from Problem 1 on Assignment 4.

## 2. Arrival and Departure Delays

The nycflights13 package provides in a data frame flights data on all flights originating from one of the three main New York City airports in 2013 and heading to airports within the US. The help page for flights describes the variables in the data set.

Create a scatterplot to show the relation between the arrival delays and the departure delays observed for these flights. Since the data set is quite large a simple scatterplot will result in a lot of over-plotting. You will need to use the techniques shown in class to create a plot that shows the key features of the data.

## 3. Evaluate a Visualization

A blog post shows this visualization of donations for research on on several diseases and the number of deaths attributed to these diseases:

The image is originally from an article at Vox.

• The chart now on the Vox site is different; comment on the key change.

• Describe the items, attributes, marks, channels, and mappings used in the visualization. Comment on how well the strength of the channels used match the importance of the featured displayed.

• Can you suggest alternatives that might improve on this visualiation in some respects?

The data are available at http://homepage.divms.uiowa.edu/~luke/data/dfunds.csv.

Write up your work in an Rmarkdown document called hw5.Rmd in your HW5 folder, and commit it to your local repository. You can commit the hw5.html as well but you do not need to.

## Make Sure Your Work Is Reproducible

One of the goals of using git, GitHub, and Rmarkdown is for you to practice creating a framework that you can hand to someone else to reproduce your analysis. This means, among other things, that

• you should not make use of files from your computer outside of your repository;

• you should not rely on being able to change the working directory to your home directory;

• you should assume that your code might be run an a case-sensitive file system.

If you are working on Windows or a Mac a good test is to go to our Linux systems, check out your repository, and check that your hw5.Rmd file can be rendered successfully to produce hw5.html. You can do this using the RStudio menus or from the R command line with

rmarkdown::render("hw5.Rmd")

Make sure your working directory is HW5 for this.

You can also run this command in a shell in your HW5 directory:

Rscript -e 'rmarkdown::render("hw5.Rmd")'

Make sure you use the right combination of single and double quotes.