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 <- NULL
personality_scores <- NULL
users <- NULL

Question 1B

Add users data to the disgust_scores table.

study1 <- NULL

Question 2

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

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.

study3 <- NULL

Question 3B

Join data from the same user_id, regardless of date. Does this give you the same data table as above?

study3_nodate <- NULL

Question 4

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

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.

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.)

study6 <- NULL 

Binding and sets

Question 7

Load new user data from users2. Bind this table and the original users table into a single table called users_all.

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?)

both_n <- NULL

Question 9

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

unique_users <- NULL

Question 10

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

first_users <- NULL

Question 11

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

second_users <- NULL