[R] Re-binning histogram data

From: Justin Ashmall <ja_at_space.mit.edu>
Date: Thu 08 Jun 2006 - 19:46:19 EST


Short Version:
Is there a function to re-bin a histogram to new, broader bins?

Long version: I'm trying to create a histogram, however my input-data is itself in the form of a fine-grained histogram, i.e. numbers of counts in regular one-second bins. I want to produce a histogram of, say, 10-minute bins (though possibly irregular bins also).

I suppose I could re-create a data set as expected by the hist() function (i.e. if time t=3600 has 6 counts, add six entries of 3600 to a list) however this seems neither elegant nor efficient (though I'd be pleased to be mistaken!). I could then re-create a histogram as normal.

I guessing there's a better solution however! Apologies if this is a basic question - I'm rather new to R and trying to get up to speed.



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Jun 08 21:00:39 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 09 Jun 2006 - 14:10:51 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.