Skip to content
Prev 111736 / 398498 Next

matrix similarity comparison

hi Carlos,

its not really clear what you're asking here. If all you want is to
see what entries are the same and which are different between two
matrices of the same dimensions, then this does it:
#same
m1==m2
#diff
m1 != m2

If you want to extract the ones that are the same,
indx <- m1==m2
[,1] [,2]  [,3]  [,4]
[1,]  TRUE TRUE FALSE  TRUE
[2,]  TRUE TRUE  TRUE FALSE
[3,] FALSE TRUE FALSE  TRUE
1 0 0 1 0 1 1 1
On 3/19/07, Carlos Guerra <carlosguerra at esa.ipvc.pt> wrote: