---
title: "Data Wrangling Practice"
author: "Wells"
date: "2/12/2021"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(ggplot2)
library(dplyr)
```


## Problem 1

**Goal**: Load required packages by running the code chunk above.









## Problem 2

**Goal**: Import the Math 141 survey data from the course website. The url is

https://reed-statistics.github.io/math141s21/data/survey141.csv



## Problem 3

**Goal**: Reduce the `hot_dog` variable to a binary variable with answers `yes` or `no`




## Problem 4

**Goal**: Change `Freshman` to `First Year` in the `year` variable





## Problem 5

**Goal**: Change the `hogwarts` variable to `hogwarts_house`




## Problem 6

**Goal**: Remove all observations with `NA` for `hogwarts_house`


## Problem 7

**Goal**: Write code to create data frames for the following tasks from Wednesday's class:


1. Sort students by Hogwarts House, and within house, by year.

2. Find the number of students in each year who think hot dogs are sandwiches.

3. Calculate the median number of college applications submitted by students of Herodotus.

4. Create a data set consisting only of categorical variables (ordered alphabetically), and with student responses ordered alphabetically, starting with the first variable.

5. Identify students whose social and economic views differ by 2 or more points.

6. Create a data set consisting of two variables: Hogwarts House and Political Views, where the Political Views score is obtained by averaging a student's Social and Economic views scores.

7. Count how many students think both that dogs should wear pants on their back legs and that hot dogs are sandwiches.

8. Among students who drink who are not freshmen, create a data set that could be used make a scatterplot of alcohol use vs. social views.


