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