[R] Simple question on binning data

Bernardo Rangel Tura tura at centroin.com.br
Sat May 15 12:23:36 CEST 2010


On Thu, 2010-05-13 at 17:31 -0400, Carl Witthoft wrote:
> It's very simple to write a "binit()" function.  If all you want to do 
> is e.g., bin 107 values into sums of 10 at a time, then write a loop 
> that sums x[10*i:11*i-1]  (not tested and not syntactically correct).
> 
> The one I wrote for myself discards any partial bin (101-107 in my 
> example) and leaves a warning note that this took place.
> 
> Carl

Hi Carl,

I think the syntactically correct is x[10*i:(11*i-1)]

-- 
Bernardo Rangel Tura, M.D,MPH,Ph.D
National Institute of Cardiology
Brazil



More information about the R-help mailing list