In this repository you will find data describing Swirl activity from the class so far this semester. Please connect RStudio to this repository.
- Open a new R Markdown file, please write and run all your commands from within the R Markdown document
- Delete the contents of the Markdown file and insert a new code block
- Load the libraries
tidyranddplyr - Create a data frame from the
swirl-data.csvfile calledDF1
The variables are:
course_name - the name of the R course the student attempted
lesson_name - the lesson name
question_number - the question number attempted
correct - whether the question was answered correctly
attempt - how many times the student attempted the question
skipped - whether the student skipped the question
datetime - the date and time the student attempted the question
hash - anonymyzed student ID
-
Create a new data frame that only includes the variables
hash,lesson_nameandattemptcalledDF2 -
Use the
group_byfunction to create a data frame that sums all the attempts for eachhashby eachlesson_namecalledDF3 -
On a scrap piece of paper draw what you think
DF3would look like if all the lesson names were column names -
Convert
DF3to this format -
Create a new data frame from
DF1calledDF4that only includes the variableshash,lesson_nameandcorrect -
Convert the
correctvariable so thatTRUEis coded as the number1andFALSEis coded as0 -
Create a new data frame called
DF5that provides a mean score for each student on each course -
Extra credit Convert the
datetimevariable into month-day-year format and create a new data frame (DF6) that shows the average correct for each day