Symmetry testing on a symmetric matrix is ​​not performed

I have a symmetric matrix (4x4) in memory. Unfortunately, sum (originalMatrix! = T (originalMatrix)) = 6. So, I subtract this matrix and read it back into memory. Now sum (dputMatrix! = T (dputMatrix)) = 0. How is this possible and how can I check the symmetry with my matrix in memory?

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!!! 
+2
source share
1 answer

This is a manifestation of FAQ 7.31. Note that if you want to completely save R objects, you must use save ().

Please note!

+3
source

All Articles