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) )
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…