projects
/
iramuteq
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ed41d53
)
list of distances
author
pierre
<ratinaud@univ-tlse2.fr>
Sun, 29 Sep 2024 16:34:02 +0000
(18:34 +0200)
committer
pierre
<ratinaud@univ-tlse2.fr>
Sun, 29 Sep 2024 16:34:02 +0000
(18:34 +0200)
Rscripts/Rgraph.R
patch
|
blob
|
history
diff --git
a/Rscripts/Rgraph.R
b/Rscripts/Rgraph.R
index
af0b351
..
0d8d3df
100644
(file)
--- 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
+ }
+}