[R] how to draw cumulative histogram

hadley wickham h.wickham at gmail.com
Tue Nov 8 15:37:47 CET 2005


> I am using R to plot some cumulative histogram for my data. Please help
> in this case.

It's not exactly a cumulative histogram, but perhaps ?ecdf is what you want:
plot(ecdf(islands))

It's also possible to abuse hist to get a cumulative histogram:
h <- hist(islands)
h$counts <- cumsum(h$counts)
plot(h)

(but that was just a quick attempt so may break other code)

Hadley




More information about the R-help mailing list