Skip to content
Prev 174679 / 398506 Next

Summarizing each row into a frequency table

Try this (haven't checked the speed):

f <- function(x) table(factor(x, c(-1, 0, 1)))
100 * prop.table(t(apply(m, 1, f)), 1)
On Mon, Mar 23, 2009 at 8:46 PM, Daren Tan <darentan76 at gmail.com> wrote: