Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Use stat_ecdf() (Figure 13-26):
library(gcookbook)# For the data set# ecdf of heightInggplot(heightweight,aes(x=heightIn))+stat_ecdf()# ecdf of ageYearggplot(heightweight,aes(x=ageYear))+stat_ecdf()
The ECDF shows what proportion of observations are at or below the given x value. Because it is empirical, the line takes a step up at each x value where there are one or more observations.