powered by
make vector positions from (non-symmetric) array index respecting dim and fixdiag
symmIndex2vectorIndex(x, dim, fixdiag = NULL)
a vector of indices in seq_len(prod(dim(x)))
seq_len(prod(dim(x)))
a matrix[,1:2] with matrix subscripts
the dimensions of the symmetric matrix
NULL assumes free diagonal, any value assumes fixed diagonal
Jens Oehlschlägel
With fixdiag = NULL
arrayIndex2vectorIndex
symmIndex2vectorIndex(rbind( c(1,1) ,c(1,10) ,c(10,1) ,c(10,10) ), dim=c(10,10)) symmIndex2vectorIndex(rbind( c(1,1) ,c(1,10) ,c(10,1) ,c(10,10) ), dim=c(10,10), fixdiag=1)
Run the code above in your browser using DataLab