Edit the code chunks below and knit the document. You can pipe your
objects to glimpse()
or print()
to display
them.
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
Add users
data to the disgust_scores
table.
study1 <- NULL
Add the users
data to the disgust_scores
data, but have the columns from the participant table first.
study2 <- NULL
Create a table with only disgust_scores
and
personality_scores
data from the same user_id
collected on the same date
.
study3 <- NULL
Join data from the same user_id
, regardless of
date
. Does this give you the same data table as above?
study3_nodate <- NULL
Create a table of the disgust_scores
and
personality_scores
data containing all of the data
from both tables.
study4 <- NULL
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
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
Load new user data from users2.
Bind this table and the original users
table into a single
table called users_all
.
users_all <- NULL
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
How many unique users are there in total across the first and second user tables?
unique_users <- NULL
How many users are in the first, but not the second, user table?
first_users <- NULL
How many users are in the second, but not the first, user table?
second_users <- NULL