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.