我在内存中有一个对称矩阵(4x4)。不幸的是,sum( originalMatrix != t( originalMatrix ))= 6,所以我把这个矩阵输入并读回内存。现在sum( dputMatrix!= t( dputMatrix) )= 0。这是怎么可能的,我如何测试我的内存矩阵的对称性?
originalMatrix = ...
sum( originalMatrix != t( originalMatrix ) ) # results in 6
dput( originalMatrix )
dputMatrix = structure(c(0.00117771346463494, -1.57864028664711e-05, 0.000293652924987303,
-9.85387333663002e-05, -1.57864028664711e-05, 0.000194782042576016,
6.9133672862693e-05, 4.23792732612071e-05, 0.000293652924987303,
6.9133672862693e-05, 0.00046216043028767, 2.70172523991749e-05,
-9.85387333663002e-05, 4.23792732612071e-05, 2.70172523991749e-05,
0.00017694896679169), .Dim = c(4L, 4L), .Dimnames = list(c("a00088630",
"a0091n", "a01010", "a01307810"), c("a00088630", "a0091n", "a01010",
"a01307810")))
sum( dputMatrix != t( dputMatrix ) ) # results in 0!!!发布于 2011-10-06 00:36:29
这是FAQ 7.31的一种表现。请注意,如果要将R对象保存为全精度,则应使用save()。
请打钩!
https://stackoverflow.com/questions/7663311
复制相似问题