1. Learn
  2. /
  3. Courses
  4. /
  5. Basic Statistics

Exercise

Cumulative Frequency

Let's try some calculations using frequencies.

Remember, you can select a specific variable using either $ or [,]. If you need to check the variables in the data set, remember that you can always use the str() function in your console.

Instructions

100 XP
  • In your console, look at how many cars have 3, 4 or 5 gears using table() on the variable gear from mtcars.
  • In your console, calculate how many of the cars have 3 or 5 gears as a percentage of the total number of cars.
  • In your script, report this percentage.