currently learning some basics in R. I have encountered a problem where R does not identify two (seemingly) identical matrices as indentical.
K <- rbind(c(63,32,32),c(69,20,31),c(58,41,30))
L <- rbind(c(36,35,65),c(61,39,36),c(43,67,25))
c3 <- solve(K%*%L)
c4 <- (solve(L)%*%solve(K))
This is the return for c3
> c3
[,1] [,2] [,3]
[1,] -0.008210912 0.002098811 0.006187541
[2,] 0.019277529 -0.007768868 -0.011693360
[3,] -0.010079058 0.005248454 0.005097116
This is the return for c4
> c4
[,1] [,2] [,3]
[1,] -0.008210912 0.002098811 0.006187541
[2,] 0.019277529 -0.007768868 -0.011693360
[3,] -0.010079058 0.005248454 0.005097116
The typeof and class of both c3 and c4 is the same. Yet this happens:
> c3 == c4
[,1] [,2] [,3]
[1,] FALSE FALSE FALSE
[2,] FALSE FALSE FALSE
[3,] FALSE FALSE FALSE