Here I have a 3 x 3 matrix and have calculated the determinant of the matrix and the determinant of the transpose of the matrix (which should be and are the same according to the code) but when comparing them to check if they are equal I am getting an output of false.
This is also true if I assign the values to other variables and check them.
Here is my code:
matrixTest <- matrix(
c(c(1,5,7),c(1,2,6),c(8,2,6)),
ncol = 3,
)
det(matrixTest)
det(t(matrixTest))
det(matrixTest) == det(t(matrixTest))
Output from R studio when running this block:
> det(matrixTest)
[1] 112
> det(t(matrixTest))
[1] 112
>
> det(matrixTest) == det(t(matrixTest))
[1] FALSE