Vector allocation in a symmetric matrix | R Documentation |
Vector allocation in a symmetric matrix.
squareform(x)
x |
An numverical vector whose size must be the one that matches the dimensions of the final matrix. See examples. |
The functions is written in C++ in order to be as fast as possible.
A symmetric matrix. The vector is allocated in the upper and in the lower part of the matrix. The diagonal is filled with zeros.
R implementation and documentation: Manos Papadakis <papadakm95@gmail.com>.
colShuffle, colVars, colmeans
x <- rnorm(1)
res<-squareform(x) ## OK
x <- rnorm(3)
res<-squareform(x) ## OK
x <- rnorm(4)
res<-squareform(x) ## not OK
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.