test_symmetry: test the symmetry of a matrix

Description Usage Arguments Value See Also Examples

View source: R/test_symmetry.R

Description

This function tells you whether a matrix is symmetric, skewed symmetric, or not symmetric. It's used by tskrr to determine which kind of homologous network is represented by the label matrix.

Usage

1
test_symmetry(x, tol = .Machine$double.eps)

Arguments

x

a matrix

tol

a single numeric value with the tolerance for comparison

Value

a character value with the possible values "symmetric", "skewed" or "none".

See Also

tskrrHomogeneous for more information on the values for the slot symmetry

Examples

1
2
3
4
5
6
mat1 <- matrix(c(1,0,0,1),ncol = 2)
test_symmetry(mat1)
mat2 <- matrix(c(1,0,0,-1), ncol = 2)
test_symmetry(mat2)
mat3 <- matrix(1:4, ncol = 2)
test_symmetry(mat3)

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