From: pierre Date: Sun, 29 Sep 2024 16:34:02 +0000 (+0200) Subject: list of distances X-Git-Url: http://iramuteq.org/git?a=commitdiff_plain;h=8c7416a3fbb508916990b82d4998dfc9a974b0ae;p=iramuteq list of distances --- diff --git a/Rscripts/Rgraph.R b/Rscripts/Rgraph.R index af0b351..0d8d3df 100644 --- a/Rscripts/Rgraph.R +++ b/Rscripts/Rgraph.R @@ -1270,3 +1270,14 @@ graph.to.file2 <- function(graph, layout, nodesfile = NULL, edgesfile = NULL, co } } + +dist2list <- function(mat, outfile = NULL) { + m <- as.matrix(mat) + xy <- t(combn(colnames(m), 2)) + m <- data.frame(xy, dist=m[xy]) + if (!is.null(outfile)) { + write.csv2(m, file=outfile) + } else { + m + } +}