?cut or ?findInterval and ?table -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] 801.408.8111
> -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > project.org] On Behalf Of Jörg Groß > Sent: Thursday, 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 <- 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 and so on) > > so I get these frequencies: > > 2, 1, 2 > > > Which functions do I have to use for this purpose? > > ______________________________________________ > R-help@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. ______________________________________________ R-help@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.