Learn R Programming

MagmaClustR (version 1.2.1)

check_symmetric: Round a matrix to make if symmetric

Description

If a matrix is non-symmetric due to numerical errors, round with a decreasing number of digits until the matrix becomes symmetric.

Usage

check_symmetric(mat, digits = 10)

Value

A matrix, rounded approximation of mat that is symmetric.

Arguments

mat

A matrix, possibly non-symmetric.

digits

A number, the starting number of digits to round from if mat is not symmetric

Examples

Run this code
TRUE

Run the code above in your browser using DataLab