Learn R Programming

xnet (version 0.1.11)

test_symmetry: test the symmetry of a matrix

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

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

Run this code
# NOT RUN {
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)

# }

Run the code above in your browser using DataLab