Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

is.symmetric.matrix

Test for symmetric numeric matrix


Description

This function returns TRUE if the argument is a numeric symmetric square matrix and FALSE otherwise.

Usage

is.symmetric.matrix(x)

Arguments

x

an R object

Value

TRUE or FALSE.

Note

If the argument is not a numeric matrix, the function displays an error message and stops. If the argument is not a square matrix, the function displays an error message and stops.

Author(s)

Frederick Novomestky fnovomes@poly.edu

References

Bellman, R. (1987). Matrix Analysis, Second edition, Classics in Applied Mathematics, Society for Industrial and Applied Mathematics.

See Also

Examples

A <- matrix( c( 1, 2, 3, 4 ), nrow=2, byrow=TRUE )
is.symmetric.matrix( A )
B <- matrix( c( 1, 2, 2, 1 ), nrow=2, byrow=TRUE )
is.symmetric.matrix( B )

matrixcalc

Collection of functions for matrix calculations

v1.0-3
GPL (>= 2)
Authors
Frederick Novomestky <fnovomes@poly.edu>
Initial release
2012-09-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.