Skip to contents

Checks if matrix is numeric, symmetric, has diagonal elements of one, has only entries in [-1, 1], and is positive definite. Prints a warning if a problem was found.

Usage

is_cor_matrix(m, tol = 1e-09)

Arguments

m

Matrix.

tol

Tolerance for checking diagonal elements.

Value

TRUE if matrix is a correlation matrix, else FALSE.