Description Usage Arguments Value Examples
asdasd
1 2 3 | set.group.vector(.G, .attr.name, .groups)
get.group.names(.G, .attr.name, .V = V(.G), .paste = T)
|
.G |
Mutation network. |
.attr.name |
Name of the new vertex attribute. |
.groups |
List with integer vector with indices of subjects for each group. |
.V |
Indices of vertices. |
.paste |
if T then return character string with concatenated group names, else return list with character vectors with group names. |
igraph object with new vertex attribute .attr.name
with binary strings for set.group.vector
.
Return character vector for get.group.names
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## 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"
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.