non.diagonal: Non Diagonal Part of a Matrix

Description Usage Arguments Value Examples

View source: R/matrix_tools.R

Description

Similarly to upper.tri and lower.tri, returns a matrix of logicals to identify the diagonal of a square matrix

Usage

1
non.diagonal(M, output = c("matrix.logical", "vector.values"))

Arguments

M

square matrix.

output

choose to either return a matrix of logical values (TRUEs, FALSEs on the diagonal, i.e. comparable behavior than upper.tri for instance) or a vector of the subsetted values of the matrix.

Value

either return a matrix of logical values (TRUEs, FALSEs on the diagonal) or a vector of the subsetted values of the matrix.

Examples

1
2
M<- matrix(sample(1:10,16,replace = TRUE),4,4)
non.diagonal(M)

R-KenK/SimuNet documentation built on Oct. 22, 2021, 1:27 a.m.