lower_vec_indices {semTests}R Documentation

Obtain indices of lower or upper triangular matrix in vec indices.

Description

Code obtained from lavaan: https://github.com/yrosseel/lavaan/blob/6f047c800206d23f246d484b9522295257614222/R/lav_matrix.R

Usage

lower_vec_indices(n = 1L, diagonal = TRUE)

Arguments

n

Dimension of square matrix.

diagonal

If TRUE, includes the diagonal elements.

Value

Indices x so that a[x] = c(a)[x] returns the elements of the lower (upper) diagonal matrix in row-wise (column-wise) order.


[Package semTests version 0.5.0 Index]