[R] sapply help

Milan Bouchet-Valat nalimilan at club.fr
Sat Feb 4 14:58:18 CET 2012

Le vendredi 03 février 2012 à 18:51 +0000, William Dunlap a écrit :
> Instead of colSums(t(aMatrix)), why not the more
> direct rowSums(aMatrix)?
Because I felt it was more didactic. The question was about counting
occurrences per column, so using rowSums() could be a little confusing
without an explanation.

Of course, your solution is faster and cleaner.

More information about the R-help mailing list