completeMatrix | R Documentation |
Completes the bottom diagonal of a matrix with the same number of rows and columns.
completeMatrix(x)
x |
A distances matrix to be completed. |
It is highly recommended to read the manual page regarding distances matrices before running this function. You can find it here: https://hugomflavio.github.io/actel-website/manual-distances.html
A matrix of distances between pairs of points.
# Create dummy matrix with upper diagonal filled.
x <- matrix(
c( 0, 1, 2, 3, 4, 5,
NA, 0, 1, 2, 3, 4,
NA, NA, 0, 1, 2, 3,
NA, NA, NA, 0, 1, 2,
NA, NA, NA, NA, 0, 1,
NA, NA, NA, NA, NA, 0),
ncol = 6, byrow = TRUE)
# inspect x
x
# run completeMatrix
completeMatrix(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.