Converts a distance matrix to a data.frame.

dist2df(inDist)

Arguments

inDist

The input distance object.

Value

A data.frame.

References

http://stackoverflow.com/q/23474729/1270695

Author

Ananda Mahto

Examples

dd <- as.dist((1 - cor(USJudgeRatings)[1:5, 1:5])/2) dist2df(dd)
#> row col value #> 1 INTG CONT 0.56659545 #> 2 DMNR CONT 0.57684427 #> 3 DILG CONT 0.49380400 #> 4 CFMG CONT 0.43154385 #> 5 DMNR INTG 0.01769236 #> 6 DILG INTG 0.06424445 #> 7 CFMG INTG 0.09295712 #> 8 DILG DMNR 0.08157452 #> 9 CFMG DMNR 0.09332092 #> 10 CFMG DILG 0.02060062