[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] Turn a directed network into a weighted undirected network
From: |
Tamas Nepusz |
Subject: |
Re: [igraph] Turn a directed network into a weighted undirected network |
Date: |
Tue, 31 May 2016 16:44:41 +0200 |
> My question is: how to convert the list 'sbg.triangle[[1]] = a, b, c'
> into 'a,b, b,c, c,a'?
Something like this would work:
> edges_of_triangle <- function (x) { c(x[1], x[2], x[2], x[3], x[3], x[1]) }
> edges_of_triangle(c("A", "B", "C"))
[1] "A" "B" "B" "C" "C" "A"
T.