f_distance2vector {sincell} | R Documentation |
Auxiliary function to convert of the lower triangular matrix of a distance matrix into an array
f_distance2vector(distance)
distance |
A distance matrix or a symmetric matrix |
Array resulting from the concatenation of the rows of the lower triangular matrix of the input symetric matrix. Array length is n*(n-1)/2, where n is the number of rows of the symetric matrix.
## Generate some data Data <- matrix(rnorm(300),ncol=10,nrow=30) ## Calculate distance matrix and transform its lower triangular matrix into a one ## dimensional array d <- f_distance2vector(as.matrix(dist(Data)))