mat2vec function

Creates a vector from a matrix

Creates a vector from a matrix

creates a vector from a matrix

mat2vec(mat,upper=FALSE)

Arguments

  • mat: a symmetric matrix
  • upper: whether the upper triangular matrix is to be copied to the vector

Returns

a vector

Examples

{ mat2vec(matrix(1:16,nrow=4)) mat2vec(matrix(1:16,nrow=4),upper=TRUE) }