Re: [R] Simple Binning of Values

2012-06-12 Thread Martin Striz
0-500" colnames(bins) <- c("bins", "count") > bins bins count 1 0-100 3 2 100-200 4 3 200-300 1 4 300-400 1 5 400-500 1 --Martin - - Original Message - From: Kathryn B Walters-Conte To: "r-help@r-project.org" Cc: Sen

Re: [R] Simple Binning of Values

2012-06-12 Thread arun
- Original Message - From: arun To: Kathryn B Walters-Conte Cc: R help Sent: Monday, June 11, 2012 10:04 PM Subject: Re: [R] Simple Binning of Values Hi Kat, Try this:  x1<-c(123, 48, 342, 442, 43, 232, 32, 129, 191, 147)   res<-cut(x1,breaks=seq(0,500,by=100)) library(reshap

Re: [R] Simple Binning of Values

2012-06-11 Thread arun
1 4 (300,400] 1 5 (400,500] 1 I am trying to figure out how to get rid of the brackets.  Otherwise, the results looks fine. A.K. - Original Message - From: Kathryn B Walters-Conte To: "r-help@r-project.org" Cc: Sent: Monday, June 11, 2012 5:22 PM Subject: [R] S

Re: [R] Simple Binning of Values

2012-06-11 Thread Jorge I Velez
Hi Kat, Something along the lines of the following might work: x <- c(123, 48, 342, 442, 43, 232, 32, 129, 191, 147) table(cut(x, c(0, 100, 200, 300, 400, 500))) See ?cut and ?table for more details. Best, Jorge.- On Mon, Jun 11, 2012 at 5:22 PM, Kathryn B Walters-Conte <> wrote: > Hello > >

[R] Simple Binning of Values

2012-06-11 Thread Kathryn B Walters-Conte
Hello I am very new to R.  I have an R task to complete that I have not been able to find a straightforward answer to as of yet.  I have a list of values. I would like to count the number of values that are in one bin, the number that fall in the next bin, etc. For example My input file is: