upperTriangleToSquareMatrix: Converting a data frame representing an upper triangle matrix...

View source: R/struc__upperTriangleToSquareMatrix.R

upperTriangleToSquareMatrixR Documentation

Converting a data frame representing an upper triangle matrix (without diagonal entries) into the original square matrix.

Description

This function retrieves IDs from the first two columns and values from the third column. Note that this function assumes the diagonal of the output matrix is comprised of a constant.creases.

Usage

upperTriangleToSquareMatrix(d, diag_val = 0)

Arguments

d

Input data frame

diag_val

The value on the diagonal (Default: NA)

Value

A synmetric matrix

Author(s)

Yu Wan (wanyuac@126.com)


wanyuac/handyR documentation built on June 10, 2024, 1:24 a.m.