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 t
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 coun
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
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(Frequ
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, 7
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, b
= lev, lab = lab )
tab <- table( groups, dnn = "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: &
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(
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 gro
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] (7
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 corre
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 i
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 cal
?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
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 perh
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 t
OTECTED]
Sent: 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:
>
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 mat
18 matches
Mail list logo