o.to.m {callsync} | R Documentation |
o.to.m
Description
Transforms a vector into a matrix where it assumes that the vector values are the lower triangular of the matrix: 'm[lower.tri(m)] = o'. It includes 0 on the diagonal.
Usage
o.to.m(o, n = seq(sqrt(length(o) + 1) + 1))
Arguments
o |
the vector containing the values for the lower triangular (required) |
n |
the names for the rows and columns of the matrix (optional) |
Value
Returns a matrix where it assumes that 'm[lower.tri(m)] = o'.
Examples
m = matrix(1:9, nrow = 3, ncol = 3)
o = m[lower.tri(m)]
m_new = o.to.m(o)
[Package callsync version 0.2.3 Index]