Re: [R] counting the frequencies of a vector

2008-10-16 Thread David Winsemius
On Oct 16, 2008, at 12:55 PM, Jorge Ivan Velez wrote: Dear Jörg, See ?cut and ?table. Is this what you want? x <- c(1, 3, 1.2, 5, 5.9) table(cut(x,breaks=c(0,2,4,6))) (0,2] (2,4] (4,6] 2 1 2 Perhaps even greater future efficiency could be had by also adding ?seq table(cut(x, bre

Re: [R] counting the frequencies of a vector

2008-10-16 Thread Jorge Ivan Velez
Dear Jörg, See ?cut and ?table. Is this what you want? x <- c(1, 3, 1.2, 5, 5.9) table(cut(x,breaks=c(0,2,4,6))) (0,2] (2,4] (4,6] 2 1 2 HTH, Jorge On Thu, Oct 16, 2008 at 12:46 PM, Jörg Groß <[EMAIL PROTECTED]> wrote: > Hi, > > > Is there a function which counts the frequencies o

Re: [R] counting the frequencies of a vector

2008-10-16 Thread Greg Snow
, October 16, 2008 10:47 AM > To: r-help@r-project.org > Subject: [R] counting the frequencies of a vector > > Hi, > > > Is there a function which counts the frequencies of the occurence of a > number within an interval? > > for example I have this vector: > > x <

Re: [R] counting the frequencies of a vector

2008-10-16 Thread Barry Rowlingson
2008/10/16 Jörg Groß <[EMAIL PROTECTED]>: > Hi, > > > Is there a function which counts the frequencies of the occurence of a > number within an interval? > > for example I have this vector: > > x <- c(1, 3, 1.2, 5, 5.9) > > and I want a vector that gives me the frequencies within an interval of 2,

[R] counting the frequencies of a vector

2008-10-16 Thread Jörg Groß
Hi, Is there a function which counts the frequencies of the occurence of a number within an interval? for example I have this vector: x <- c(1, 3, 1.2, 5, 5.9) and I want a vector that gives me the frequencies within an interval of 2, beginning at 0 (so the intervals are 0-2, 2-4, 4-6 a