Skip to contents

This function extracts the elements from the upper triangular part of a matrix.

Usage

as.undirected.vector(x, diag = FALSE)

Arguments

x

A numeric matrix from which to extract upper triangular elements.

diag

A logical value indicating whether to include the diagonal elements. Defaults to FALSE.

Value

A vector containing the upper triangular elements of the matrix.