Skip to content
Prev 263309 / 398502 Next

ddply to count frequency of combinations

On Jun 21, 2011, at 2:30 PM, Idris Raja wrote:

            
Here's a non plyr approach:

 > tab.df <- as.data.frame(table(df))
 > tab.df[tab.df$Freq > 0, ]
    x y Freq
1  1 1    2
4  4 1    1
7  2 2    2
13 3 3    1
18 3 4    1
19 4 4    1
25 5 5    1

Did you know that there is a newsgroup specifically set up for plyr  
questions?

manipulatr at googlegroups.com