long2squareform: Convert long table to square form
Description
Convert a distance dataframe in long table form to a square matrix form.
Usage
long2squareform(data, symmetric = TRUE)
Value
Dataframe in square matrix form, rownames and colnames are labels. If the long table only contains \(C_n^2\) rows and `symmetric` is set to FALSE, then only lower triangle positions in the result is filled.
Arguments
data
Dataframe in long table form. The first and second columns are labels and the third column stores the distance values.
symmetric
Whether the distance matrix are symmetric (if cost matrix is not, then the distance matrix is also not).