Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
現在、2つのマトリックスがあり、それを比較して、それらが完全に同等であるかどうかを確認したいと思います。Rにはそれを行う機能はありますか?
上記のように、?all.equalまたはで始まり?identicalます。その後、行列が等しくないことがわかった場合は、列ごとに比較することをお勧めします。これでうまくいくかもしれません:
?all.equal
?identical
mapply(as.data.frame(m1),as.data.frame(m2),FUN=function(v1,v2) all(v1==v2) )