Description Usage Arguments Value Examples
Convert the upper triangular part of a matrix to a full symmetric matrix.
1 | upper2full(up, diagval = NULL)
|
up |
A matrix in which the upper trianglular part is of interest. |
diagval |
A vector of values to be used for the diagonal of the returned
symmetric matrix. May be the same length as each dimension of |
A symmetric matrix the same dimensions as up
, with diagonal values
assigned according to diagval
.
1 2 3 4 | m <- matrix(1:16, nrow=4, byrow=TRUE)
upper2full(m)
upper2full(m, 0)
upper2full(m, 1:4)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.