vectorizeMatrix: Turn a matrix into a vector of non-redundant components

View source: R/Functions.R

vectorizeMatrixR Documentation

Turn a matrix into a vector of non-redundant components

Description

A convenient function to turn a matrix into a vector of non-redundant components. If the matrix is non-symmetric, returns a vector containing all entries of the matrix. If the matrix is symmetric, only returns the upper triangle and optionally the diagonal.

Usage

vectorizeMatrix(M, diag = FALSE)

Arguments

M

the matrix or data frame to be vectorized.

diag

logical: should the diagonal be included in the output?

Value

A vector containing the non-redundant entries of the input matrix.

Author(s)

Steve Horvath


WGCNA documentation built on Sept. 18, 2024, 5:08 p.m.

Related to vectorizeMatrix in WGCNA...