Session Ready
Exercise

Data exploration with a barplot

The dataset introduced in the previous exercise is loaded in your workspace under the name ab. Have a look at the dataset by typing head(ab) in the console. You should observe the following variables in the dataset:

  • subject: unique identifier for each subject
  • conversation: level of conversation difficulty
  • driving : level of driving difficulty in the simulator
  • errors: number of driving errors made
Instructions
100 XP
  • Use the tapply() function to create the 6 subgroups and assign the result to ab_groups. The code is provided for you, but take a few seconds to understand what it does.
  • Replicate the barplot displayed using the barplot() function. Check out ?boxplot to get a feeling for how it works. The colors used are "orange" and "blue". Make sure to include the legend and check the hint if you need some extra support!