Displaying 1 result from an estimated 1 matches for "matcolcomp".
2008 Nov 10
1
comparing rows - a possible solution
...could sum up the rows:
rowSums(testmat1 == testmat2 )
and when you compare it with the length,
you get a column-based match-boolean:
rowSums(testmat1 == testmat2 ) == nrow(testmat1)
or if you need the negation of it:
!rowSums(testmat1 == testmat2 ) == nrow(testmat1)
and as functions:
matcolcomp <-function(m1,m2) { rowSums(m1 == m2) == nrow(m1) }
or
matcolcomp <-function(m1,m2) { ! ( rowSums(m1 == m2) == nrow(m1) ) }
Ciao,
Oliver