is.symmetric | R Documentation |
Symmetric matrix
is.symmetric(x)
x |
object to be tested |
returns TRUE if the argument is a symmetric square matrix, or FALSE with a message otherwise
M <- matrix(c(11, 12, 13, 12, 22, 23, 13, 23, 33), nrow = 3)
is.symmetric(M) #is TRUE
M[1,2] <- 99
is.symmetric(M) #is FALSE with a message
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.