Converts a (distance) matrix to a data.frame.

matrix_to_df(x, all = FALSE)

Arguments

x

a matrix.

all

a logical value. If TRUE (default), keep cells with NA.

Value

A data.frame with the following three columns: from (the first site), to (the second site) and distance (the value of the link between two sites).

Examples

# Add an example ----