is_symmetric: Test symmetry of a matrix

Description Usage Arguments Value Examples

View source: R/is_symmetric.R

Description

The function isSymmetric tests for symmetry of a matrix but also takes row and column names into account. This function is a toned-down (and slightly faster) version that ignores row and column names. Currently, the function only works for real matrices, not complex ones.

Usage

1
is_symmetric(x, tol = 100 * .Machine$double.eps)

Arguments

x

a matrix to be tested.

tol

the tolerance for comparing the numbers.

Value

a logical value indicating whether or not the matrix is symmetric

Examples

1
2
3
4
5
x <- matrix(1:16,ncol = 4)
is_symmetric(x)

x <- x %*% t(x)
is_symmetric(x)

xnet documentation built on Feb. 4, 2020, 9:10 a.m.