The tables package may be of use to you for this.
On Fri, Jan 11, 2013 at 4:17 AM, Pancho Mulongeni <
p.mulong...@namibia.pharmaccess.org> wrote:
> Hi, I have a dataframe with n columns, but I am only looking at five of
> them. And lots of rows, over 700.
> So I would like to find frequencies fo
You could use a variant of apply(), probably sapply
For example
d <- as.data.frame( matrix(sample(0:1, 200, replace=TRUE), ncol=5))
head(d)
sapply(d, table)
S Ellison
> -Original Message-
> From: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] On Behalf Of Pancho M
Yes thank you, that worked.
-Original Message-
From: John Kane [mailto:jrkrid...@inbox.com]
Sent: Friday, January 11, 2013 4:23 PM
To: Pancho Mulongeni; R help
Subject: RE: [R] Using table to get frequencies of several factors at once
Does something like this do what you want? It
Does something like this do what you want? It returns a list of tables
md <- data.frame((matrix(sample(1:5, 100, replace = TRUE),nrow= 10)))
str(md)
apply(md, 2, table)
John Kane
Kingston ON Canada
> -Original Message-
> From: p.mulong...@namibia.pharmaccess.org
> Sent: Fri, 11 J
4 matches
Mail list logo