An R Introduction to Statistics

Range

The range of an observation variable is the difference of its largest and smallest data values. It is a measure of how far apart the entire data spreads in value.

Range = Largest Value− Smallest Value

Problem

Find the range of the eruption duration in the data set faithful.

Solution

We apply the max and min function to compute the largest and smallest values of eruptions, then take the difference.

> duration = faithful$eruptions     # the eruption durations 
> max(duration)  min(duration)     # apply the max and min functions 
[1] 3.5

Answer

The range of the eruption duration is 3.5 minutes.

Exercise

Find the range of the eruption waiting periods in faithful.