Skip to content

finding rows in a matrix that match a vector

1 message · Uwe Ligges

#
On 28.01.2012 05:43, Melissa Patrician wrote:
If you like the apply way, you have a vector v and your matrix M:

sum(apply(table.combos, 1, function(x) all(x == mine)))

Uwe Ligges