Re: [R] Incrementally building histograms

2008-11-05 Thread Gabor Grothendieck
You can eliminate the loop like this (untested): cnt <- function(file) { data <- scan(file, quiet = TRUE) hist(data, plot = FALSE, breaks = breaks)$counts } Reduce("+", sapply(files, cnt)) On Wed, Nov 5, 2008 at 8:01 PM, Andre Nathan <[EMAIL PROTECTED]> wrote: > Hello > > I need to build a his

Re: [R] Incrementally building histograms

2008-11-05 Thread Rolf Turner
On 6/11/2008, at 2:01 PM, Andre Nathan wrote: Hello I need to build a histogram from data (numbers in the [0,1] interval) stored in a number of different files. The total amount of data is very large, so I can't load everything to memory and then simply call hist(). Since what I actually n

[R] Incrementally building histograms

2008-11-05 Thread Andre Nathan
Hello I need to build a histogram from data (numbers in the [0,1] interval) stored in a number of different files. The total amount of data is very large, so I can't load everything to memory and then simply call hist(). Since what I actually need are the histogram counts, I'm currently doing it l