```{r setup, include=FALSE}
# please do not alter this code chunk
knitr::opts_chunk$set(echo = TRUE,
                      message = FALSE, 
                      error = TRUE)

library(tidyverse)
library(reprores)

# install the class package reprores to access built-in data
# devtools::install_github("psyteachr/reprores-v3")
# or download data from the website
# https://psyteachr.github.io/reprores/data/data.zip
```

Edit the code chunks below and knit the document. You can pipe your objects to `glimpse()` or `print()` to display them.

## Mutating joins

### Question 1A

Load the following data from the reprores package (or access the linked CSV files online). Each participant is identified by a unique `user_id`.

* [`disgust_scores`](https://psyteachr.github.io/reprores/data/disgust_scores.csv)
* [`personality_scores`](https://psyteachr.github.io/reprores/data/personality_scores.csv)
* [`users`](https://psyteachr.github.io/reprores/data/users.csv)


```{r ex-1a}
disgust_scores <- NULL
personality_scores <- NULL
users <- NULL
```

### Question 1B

Add `users` data to the `disgust_scores` table.

```{r ex-1b}
study1 <- NULL
```

### Question 2

Add the `users` data to the `disgust_scores` data, but have the columns from the participant table first.

```{r ex-2}
study2 <- NULL
```

### Question 3A

Create a table with only `disgust_scores` and `personality_scores` data from the same `user_id` collected on the same `date`.

```{r ex-3}
study3 <- NULL
```


### Question 3B

Join data from the same `user_id`, regardless of `date`. Does this give you the same data table as above?
    
```{r ex-3-i}
study3_nodate <- NULL
```


### Question 4

Create a table of the `disgust_scores` and `personality_scores` data containing _all_ of the data from both tables.

    
```{r ex-4}
study4 <- NULL
```

## Filtering joins

### Question 5

Create a table of just the data from the `disgust_scores` table for users who completed the `personality_scores` questionnaire that same day.
    
```{r ex-5}
study5 <- NULL
```

    
### Question 6

Create a table of data from `users` who did not complete either the `personality_scores` questionnaire or the `disgust_scores` questionnaire. (_Hint: this will require two steps._)

    
```{r ex-6}
study6 <- NULL 
```

## Binding and sets

### Question 7

Load new user data from [users2](https://psyteachr.github.io/reprores/data/users2.csv). Bind this table and the original `users` table into a single table called `users_all`.

```{r ex-7}
users_all <- NULL
```


### Question 8

How many users are in both the first and second user table? Use code to get this number; don't read the row number from the environment and type it in. (_Hint: What does `nrow(mtcars)` return?_)
    
```{r ex-8}
both_n <- NULL
```

### Question 9

How many unique users are there in total across the first and second user tables?

```{r ex-9}
unique_users <- NULL
```

### Question 10

How many users are in the first, but not the second, user table?

```{r ex-10}
first_users <- NULL
```

### Question 11

How many users are in the second, but not the first, user table?

```{r ex-11}
second_users <- NULL
```

