Learn R Programming

spaa (version 0.2.2)

list2dist: Convert pairwise list to distance matrix

Description

Convert pairwise list to distance matrix

Usage

list2dist(dat)

Value

distance matrix

Arguments

dat

dataframe with three columns

Author

Jinlong Zhang jinlongzhang01@gmail.com

Details

Dataframe with first column as the column names in the distance matrix, second column as the rownames in the distance matrix, third column the values.

References

Tuomisto, H. (2003). "Dispersal, Environment, and Floristic Variation of Western Amazonian Forests." Science 299(5604): 241-244.

See Also

dist2list

Examples

Run this code

##list2dist() example
x <- matrix(rnorm(100), nrow=5)
sampledata <- dist(x)
ddd <- dist2list(sampledata)
list2dist(ddd)

Run the code above in your browser using DataLab