Re: [R] Cumulative lattice histograms

From: Dieter Menne <>
Date: Mon, 12 May 2008 09:36:20 +0000 (UTC)

Ola Caster <ola.caster <at>> writes:

> It's fairly straightforward to plot cumulative histograms using the hist()
> function. You do something like:
> h <- hist(rnorm(100), plot=FALSE)
> h$counts<- cumsum(h$counts)
> plot(h)
> However, I have failed to find any example where this is done using the
> lattice histogram() function.

This is not a full solution to your problem with the red line, but at least comes close (hope so) to your original hist with lattic

h = sort(rnorm(100),decreasing=TRUE)
df = data.frame(h=h,cum=cumsum(h))

Dieter mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Mon 12 May 2008 - 09:40:45 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 12 May 2008 - 10:30:41 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive