[R] how to draw cumulative histogram

(Ted Harding) Ted.Harding at nessie.mcc.ac.uk
Tue Nov 8 22:35:49 CET 2005


On 08-Nov-05 Liaw, Andy wrote:
> I'm not sure what a cumulative histogram is, but does the following
> help?
> 
> x <- rnorm(100)
> plot(ecdf(x))
> 
> Andy

Maybe what is wanted is like the following:

  x<-rnorm(1000)
  h<-hist(x)
  h$counts<-cumsum(h$counts)
  plot.histogram(h)

Best wishes,
Ted.

>> From: Lisa Wang
>> 
>> Hello there,
>> 
>> I am using R to plot some cumulative histogram for my data. 
>> Please help in this case.
>> 
>> Thank you
>> 
>> Lisa Wang
>> Princess Margaret Hospital
>> Toronto
>> phone 416 946 4501 ext.4883


--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk>
Fax-to-email: +44 (0)870 094 0861
Date: 08-Nov-05                                       Time: 21:35:45
------------------------------ XFMail ------------------------------




More information about the R-help mailing list