Dear all, I have a vector like this:
z = rep(c(M,F),c(50,60))
How can I get the following frequency table:
Sex counts %
F60 54.5
M 50 45.5
I try:
DD- function(data,...)
{
n - nobs(data)
out - c(Frequency
And look at ?prop.table too.
On 21/09/06, lamack lamack [EMAIL PROTECTED] wrote:
Dear all, I have a vector like this:
z = rep(c(M,F),c(50,60))
How can I get the following frequency table:
Sex counts %
F60 54.5
M 50 45.5
You might want to look at the CrossTable function in the gmodels
package (in the gregmisc bundle).
On 21/09/06, lamack lamack [EMAIL PROTECTED] wrote:
Dear all, I have a vector like this:
z = rep(c(M,F),c(50,60))
How can I get the following frequency table:
Sex counts %
F
Robert W. Baer, Ph.D.
Associate Professor
Department of Physiology
A. T. Still University of Health Science
800 W. Jefferson St.
Kirksville, MO 63501-1497 USA
- Original Message -
z = rep(c(M,F),c(50,60))
How can I get the following frequency table:
Hi,
See if this generic function I made can help you.
data - c(65, 70, 85, 65, 65, 65, 62, 55, 82, 59,
55, 66, 74, 55, 65, 56, 80, 73, 45, 64,
75, 58, 60, 56, 60, 65, 53, 63, 72, 80,
90, 95, 55, 70, 79, 62, 57, 65, 60, 47,
61, 53, 80,
This must be FAQ, but I can't find it in archives or with a site search.
I am trying to construct a frequency table. I guess this should be done with
table. Or perhaps factor and split. Or prop.table. cut? findInterval? Argh!
Please correct me if what I am looking for is not called a frequency
I guess you want something like:
table(cut(zz$x9, c(-Inf, seq(40, 90, by=10), Inf)))
HTH,
Andy
From: Kai Hendry
This must be FAQ, but I can't find it in archives or with a
site search.
I am trying to construct a frequency table. I guess this
should be done with
table. Or perhaps
?data.frame
data.frame( table(cut(x, seq(0, 1, by=0.1))) )
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Kai Hendry
Sent: 17 March 2004 14:55
To: [EMAIL PROTECTED]
Subject: [R] Frequency table
This must be FAQ, but I can't find it in archives
Kai Hendry wrote:
This must be FAQ, but I can't find it in archives or with a site search.
I am trying to construct a frequency table. I guess this should be done with
table. Or perhaps factor and split. Or prop.table. cut? findInterval? Argh!
Please correct me if what I am looking for is not
Kai Hendry [EMAIL PROTECTED] writes:
This must be FAQ, but I can't find it in archives or with a site search.
I am trying to construct a frequency table. I guess this should be done with
table. Or perhaps factor and split. Or prop.table. cut? findInterval? Argh!
Please correct me if what
On Wed, 2004-03-17 at 08:55, Kai Hendry wrote:
This must be FAQ, but I can't find it in archives or with a site search.
I am trying to construct a frequency table. I guess this should be done with
table. Or perhaps factor and split. Or prop.table. cut? findInterval? Argh!
Please correct me
On Wed, Mar 17, 2004 at 04:55:19PM +0200, Kai Hendry wrote:
I am trying to construct a frequency table. I guess this should be done with
table. Or perhaps factor and split. Or prop.table. cut? findInterval? Argh!
I got this far:
table(cut(zz$x9, brk))
(40,50] (50,60] (60,70] (70,80]
Kai Hendry [EMAIL PROTECTED] writes:
40-49 2
50-59 15
60-69 20
70-79 19
80-89 12
90-99 2
Here's another solution for this 10-year age group thing:
tt-table(zz%/%10)
n - names(tt)
names(tt) - paste(n,0,-,n,9,sep=)
tt
data.frame(count=c(tt))
Beware that empty groups are
On 17 Mar 2004, Peter Dalgaard wrote:
Kai Hendry [EMAIL PROTECTED] writes:
40-49 2
50-59 15
60-69 20
70-79 19
80-89 12
90-99 2
Here's another solution for this 10-year age group thing:
tt-table(zz%/%10)
n - names(tt)
names(tt) - paste(n,0,-,n,9,sep=)
tt
= Range )
as.data.frame( tab )
# for graphical output:
bp - barplot( tab )
text( bp, tab, tab, pos = 3, xpd = TRUE )
---
Date: Wed, 17 Mar 2004 16:55:19 +0200
From: Kai Hendry [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [R] Frequency table
This must be FAQ, but I
Prof Brian Ripley [EMAIL PROTECTED] writes:
tt-table(zz%/%10)
n - names(tt)
names(tt) - paste(n,0,-,n,9,sep=)
tt
data.frame(count=c(tt))
Beware that empty groups are silently zapped, though.
FWIW, table(factor(zz%/%10, levels=0:9)) avoids that
I knew, but then you'd basically
Professor Baron writes:
A neat trick with table() is that you can use it to tabulate
columns of a matrix (for example) with:
apply(mymatrix,2,table)
OK, I'll bite:
x1 - matrix(1:3,7,4,byrow=T)
Warning message:
Replacement length not a multiple of the elements to replace in
: Wednesday, June 25, 2003 2:13 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [R] frequency table
Professor Baron writes:
A neat trick with table() is that you can use it to tabulate
columns of a matrix (for example) with:
apply(mymatrix,2,table)
OK, I'll
18 matches
Mail list logo