Turn a matrix into a vector of non-redundant components
非冗余组件的向量旋转矩阵
译者:生物统计家园网 机器人LoveR
描述----------Description----------
A convenient function to turn a matrix into a vector of non-redundant components. If the matrix is non-symmetric, returns a vector containing all entries of the matrix. If the matrix is symmetric, only returns the upper triangle and optionally the diagonal.
一个方便的功能,把一个矩阵的非冗余组件成一个向量。如果矩阵是非对称的,则返回一个向量,包含所有项目的矩阵。如果矩阵是对称的,只返回上三角和任选的对角线。
用法----------Usage----------
vectorizeMatrix(M, diag = FALSE)
参数----------Arguments----------
参数:M
the matrix or data frame to be vectorized.
矩阵或数据框以进行矢量化。
参数:diag
logical: should the diagonal be included in the output?
逻辑:应包含在输出的对角线?
值----------Value----------
A vector containing the non-redundant entries of the input matrix.
一种向量,包含的非冗余的输入矩阵的条目。