[R] count data with a specific range

jim holtman jholtman at gmail.com
Tue Sep 30 01:39:14 CEST 2008


> data<-c(2,6,13,26,19,25,18,11,22,25)
> table(cut(data, breaks=c(0,10,20,30)))

 (0,10] (10,20] (20,30]
      2       4       4


On Mon, Sep 29, 2008 at 5:41 PM, sandsky <realstone at hotmail.com> wrote:
>
> Hi there,
>
> The data is
>
> data<-c(2,6,13,26,19,25,18,11,22,25)
>
> I want to count data for these rages:
>
> [0~10]:
> [11~20]:
> [21-30]:
>
> Is anyone can help me?
>
> Thank you in advance
> --
> View this message in context: http://www.nabble.com/count-data-with-a-specific-range-tp19732290p19732290.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem that you are trying to solve?



More information about the R-help mailing list