# Relationships

Due by 11:59 PM on Monday, September 25, 2017

Another super important note: Once again, you’ll complete this assignment in R Markdown. I’ve created a blank R Markdown file with the questions and some hints. Download this file and complete your assignment in it.Your browser will most likely open it as a new tab instead of downloading the file. Either right click on the link and choose “Save link as…” or copy and paste the text into a blank R Markdown file in RStudio.

I recommend saving it within an RStudio project.

E-mail me a Word file or a PDF of the final compiled document.

If you run into problems, check with your classmates or come by my office!

Write a 500-word memo about the assigned readings for this week. You can use some of the prompt questions there if you want:

• How can you correctly and honestly communicate relationships between variables? How can you communicate the uncertainty in those relationships?
• What are the dangers of visualizing two variables?
• When is it appropriate to use two y-axes?

As you write the memo, also consider these central questions:

• How do these readings connect to our main goal of discovering truth?
• How does what I just read apply to me?
• How can this be useful to me?

## Task 2: Hans Rosling redux

For this part of the homework, you get to be just like Hans Rosling and play with data on health (life expectancy) and wealth (GDP per capita). The data originally comes from World Bank statistics, but to make life easier, there’s an R package called “gapminder” that includes the data, so you don’t have to download and clean any CSV or Excel files. If you don’t have the package installed, run install.packages("gapminder") or use the “Packages” panel in RStudio.

## Bonus $$\LaTeX$$ tips

Working with $$\LaTeX$$ can be a little tricky, even with R Markdown converting everything for you. $$\LaTeX$$ was invented before Unicode, so it can choke on characters like é and ü (you have to type those as {\'e} or {\"u} in raw $$\TeX$$, which is awful). The font is named Computer Modern. Avid LaTeX users claim it’s the best font in the universe, but it’s not.

It’s also really really hard to change the default font, which is kind of ugly.

Fortunately, when you installed the massive MacTeX or MikTeX programs, you also installed a more modern implementation of the LaTeX typesetting engine, named XeTeX (or xelatex), which can handle Unicode characters and use any Open Type font you have installed on your computer.

Using xelatex and custom fonts when knitting to PDF is fairly easy. Add this to your metadata at the top of your document:

---
title: "Whatever"
author: "Whatever"
mainfont: "Comic Sans MS"
fontsize: "10pt"
output:
pdf_document:
latex_engine: xelatex
---

(But don’t actually use Comic Sans because ew.)

You can see all the possible configuration options for PDF output, HTML output, and Word output at RStudio’s R Markdown site.