Re: [R] Count the number of occurences in ranges

2009-07-16 Thread torpedo fisken
Thanks, 'cut()' was indeed what I was looking for thanks 2009/7/16 : > Hi: I'm not sure if I understand what you want but below might help you ? > see cut for more details by doing ?cut. > > > probs<-c(0.001,0.5,0.02,.05,0.12,0.23,0.5,0.6,0.59,0.7) > probs > > temp <- cut(probs,breaks=seq(0,1,le

Re: [R] Count the number of occurences in ranges

2009-07-15 Thread Jorge Ivan Velez
Dear torpedo, Take a lookat ?cut and its examples. HTH, Jorge On Wed, Jul 15, 2009 at 11:26 PM, torpedo fisken wrote: > I got a vector of probabilities like, > probs<-c(0.001,0.5,0.02,1,.) > > Is there any nice and easy builtin function to get the number of > occurences within some specifi

[R] Count the number of occurences in ranges

2009-07-15 Thread torpedo fisken
I got a vector of probabilities like, probs<-c(0.001,0.5,0.02,1,.) Is there any nice and easy builtin function to get the number of occurences within some specified probabality range. Like with 2% it would be occur[1] = sum(probs[probs>0&probs<0.02]) occur[2] = sum(probs[probs>0.02&probs<0.04