# NOT RUN {
data(twb)
twb.shared <- shared.repertoire(twb)
G <- mutation.network(twb.shared)
G <- set.group.vector(G, "twins", list(A = c(1,2), B = c(3,4))) # <= refactor this
get.group.names(G, "twins", 1) # "A|B"
get.group.names(G, "twins", 300) # "A"
get.group.names(G, "twins", 1, F) # list(c("A", "B"))
get.group.names(G, "twins", 300, F) # list(c("A"))
# Because we have only two groups, we can assign more readable attribute.
V(G)$twin.names <- get.group.names(G, "twins")
V(G)$twin.names[1] # "A|B"
V(G)$twin.names[300] # "A"
# }
Run the code above in your browser using DataLab