Currently, I have two matrixes, and want to compare it and see whether they are exactly equivalent. In R, is there any function to do that?
As stated above start with ?all.equal
or ?identical
. If you then find that your matrices are unequal, you may want to compare them column by column. This might do the trick:
mapply(as.data.frame(m1),as.data.frame(m2),FUN=function(v1,v2) all(v1==v2) )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With