Get startedGet started for free

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.

This exercise is part of the course

Basic Statistics

View Course

Exercise instructions

  • 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.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# What percentage of cars have 3 or 5 gears?
Edit and Run Code