lower | R Documentation |
Convert a symmetric distance matrix to a column order lower triangular matrix.
lower(m)
m |
a symmetric distance matrix. |
Converts a symmetric matrix, for example a dissimilarity matrix,
into a column order lower-triangular matrix. This may be useful
to format the input for certain clustering and ordination functions.
Note that lower()
used on a 1x1 matrix will return the single
element, which may not be the correct behavior in all cases,
while full()
used on a single element will return a 2x2 matrix.
column order lower triangular matrix.
Sarah Goslee
full
, fixdmat
x.vec <- seq_len(6)
x.vec
# Make an R-style column order symmetric matrix
full(x.vec)
# Extract the lower triangle from a symmetric matrix
# in column order
lower(full(x.vec))
# Convert to or from a row order symmetric matrix
fixdmat(x.vec)
lower(fixdmat(x.vec))
fixdmat(c(1, 2, 4, 3, 5, 6))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.