[R] Bucketting data

ronggui 0034058 at fudan.edu.cn
Mon Jun 20 14:59:20 CEST 2005


?unique


On Mon, 20 Jun 2005 13:50:22 +0100
"Uzuner, Tolga" <tolga.uzuner at csfb.com> wrote:

> Hi,
> 
> Am sure this is a trivial question but for some reason, haven't been able to figure it out.
> 
> I want to bucket data in a vector, and then iterate over the buckets.
> 
> Say the data set is:
> 
> > cleandata[,4]
>  [1]  26  26  26  26  26  26  26  26  26  26  26  26  61  61  61  61  61  61  61  61  61  61  61  89  89  89  89  89  89  89 180 180 180 180 362 544 544 544
> [39] 544 544 544 544 544 544 544
> 
> This has the buckets: 
> 
> 26 61 89 180 362 544
> 
> I'd like something which gives me a vector of these buckets, i.e. bucket(cleandata[,4])=vector of 26 61 89 180 362 544
> 
> and length(bucket(cleandata[,4]))=6
> 
> Thanks,
> Tolga
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ==============================================================================
> Please access the attached hyperlink for an important electronic communications disclaimer: 
> 
> http://www.csfb.com/legal_terms/disclaimer_external_email.shtml
> 
> ______________________________________________
> R-help at 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


-- 
Department of Sociology
Fudan University,Shanghai
Blog:http://sociology.yculblog.com




More information about the R-help mailing list