Thanks Charles, ftable() works perfectly.
-Original Message-
From: Charles C. Berry [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 23, 2008 5:06 PM
To: Hutchinson,David [PYR]
Cc: r-help@r-project.org
Subject: Re: [R] Counting character occurrences in data frame
See
See
?ftable
?as.data.frame
?xtabs
e.g.
ftable( xtabs( ~code+year+month, your.df ), col.vars=1 )
as.data.frame( xtabs(~code+year+month, your.df ) )
HTH,
Chuck
On Tue, 23 Sep 2008, Hutchinson,David [PYR] wrote:
Hi R-Users,
I have a data frame contai
Try this:
with(DF, tapply(code, list(year, month, code), length))
On Tue, Sep 23, 2008 at 8:10 PM, Hutchinson,David [PYR]
<[EMAIL PROTECTED]> wrote:
> Hi R-Users,
>
> I have a data frame containing year, month, day, and code columns. The
> code column is a unique character of set ('E','A','B') -
Hi R-Users,
I have a data frame containing year, month, day, and code columns. The
code column is a unique character of set ('E','A','B') - I am trying to
determine an efficient way of summarizing the count of each of these
codes by month and year without having to use for...loops and subsets.
Do
4 matches
Mail list logo