symMat | R Documentation |
Creates a square symmetric matrix from a vector.
symMat(x, diag = TRUE, byrow = FALSE, names = FALSE)
x |
A numeric vector used to fill the upper or lower triangle of the matrix. |
diag |
Logical. If |
byrow |
Logical. If |
names |
Either a logical or a character vector of names for the rows and columns of the matrix.
If |
A symmetric square matrix based on column major ordering of the elements in x
.
Originally from metaSEM::vec2symMat
, Mike W.-L. Cheung <mikewlcheung@nus.edu.sg>; modified by Michael Friendly
symMat(1:6) symMat(1:6, byrow=TRUE) symMat(5:0, diag=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.