Re: [R] count data with a specific range

2010-06-24 Thread Joris Meys
see ?levels eg: x <- rnorm(10) y <- cut(x,c(-10,0,10)) levels(y)<-c("-10-0","0-10") cheers Joris On Thu, Jun 24, 2010 at 4:14 AM, Yi wrote: > Yeap. It works. Just to make the result more beautiful. > > One more question. > > The interval is showns as (0,10]. > > Is there a way to change it into

Re: [R] count data with a specific range

2010-06-23 Thread Joris Meys
see ?cut Cheers Joris On Thu, Jun 24, 2010 at 2:57 AM, Yi wrote: > I would like to prepare the data for barplot. But I only have the data frame > now. > > x1=rnorm(10,mean=2) > x2=rnorm(20,mean=-1) > x3=rnorm(15,mean=3) > data=data.frame(x1,x2,x3) > > If there a way to put data within a specific

[R] count data with a specific range

2010-06-23 Thread Yi
I would like to prepare the data for barplot. But I only have the data frame now. x1=rnorm(10,mean=2) x2=rnorm(20,mean=-1) x3=rnorm(15,mean=3) data=data.frame(x1,x2,x3) If there a way to put data within a specific range? The expected result is as follows: range x1 x2

Re: [R] count data with a specific range

2008-09-30 Thread sandsky
I am converting exact time data to interval data and generate samples via Bootstraping. I had a quite long code to get the frequency but your help makes it simpler. Thank you.. jholtman wrote: > >> data<-c(2,6,13,26,19,25,18,11,22,25) >> table(cut(data, breaks=c(0,10,20,30))) > > (0,10] (10,

Re: [R] count data with a specific range

2008-09-29 Thread jim holtman
> 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 <[EMAIL PROTECTED]> wrote: > > Hi there, > > The data is > > data<-c(2,6,13,26,19,25,18,11,22,25) > > I want to count data for

Re: [R] count data with a specific range

2008-09-29 Thread Peter Alspach
Subject: [R] count data with a specific range > > > 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

[R] count data with a specific range

2008-09-29 Thread sandsky
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