Exercise

Merging two files

choc_alts and choc_choice are still loaded. In the last exercise, you manually identified the rows in each file corresponding to the same choice. In this exercise, you'll merge the two files together to get the chocolate data back to long format.

Instructions

100 XP
  • Merge the choc_choice and choc_alts files together matching on the Subject and Trial. Assign the result to choc_merge.
  • Convert the Selection variable in choc_merge from an integer indicating the alternative that was chosen to a logical (TRUE/FALSE) as you have done in previous exercises.
  • Use head() to inspect choc_merge.