Learn R Programming

graph4lg (version 1.8.0)

pw_mat_to_df: Convert a pairwise matrix into an edge-list data.frame

Description

The function converts a pairwise matrix into an edge-list data.frame

Usage

pw_mat_to_df(pw_mat)

Value

An object of class data.frame

Arguments

pw_mat

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.

  • An object of class dist. In that, its column numbers are used to create IDs in the resulting data.frame.

Author

P. Savary

Examples

Run this code
data(data_tuto)
pw_mat <- data_tuto[[1]]
df <- pw_mat_to_df(pw_mat)

Run the code above in your browser using DataLab