MAT_vector2full: Reconstructs a symmetric matrix based on a vector of values...

View source: R/matrices.R

MAT_vector2fullR Documentation

Reconstructs a symmetric matrix based on a vector of values of one of the halves.

Description

Returns a symmetric matrix.

Usage

MAT_vector2full(x, diag = FALSE, byrow = FALSE, diag_value = 0)

Arguments

x

(vector) A vector of values.

diag

(logical scalar) Whether the diagonal values are included or not. Defaults to FALSE.

byrow

(logical scalar) Whether the values were extracted by row or column. Defaults to FALSE which matches the output from e.g. dist().

diag_value

(scalar) Which value to fill in the diagonal if necessary.

Examples

MAT_vector2full(1:3)

Deleetdk/kirkegaard documentation built on April 1, 2024, 2:23 a.m.