powered by
The function converts a pairwise matrix into an edge-list data.frame
pw_mat_to_df(pw_mat)
An object of class data.frame
data.frame
A pairwise matrix which can be:
An object of class matrix. It must have the same row names and column names. If values represent distances, diagonal elements should be equal to 0.
matrix
An object of class dist. In that, its column numbers are used to create IDs in the resulting data.frame.
dist
P. Savary
data(data_tuto) pw_mat <- data_tuto[[1]] df <- pw_mat_to_df(pw_mat)
Run the code above in your browser using DataLab