xTB2IG | R Documentation |
xTB2IG
is supposed to convert an igraph from one or two tibbles.
xTB2IG(edges, nodes = NULL, directed = FALSE, intersected = NULL)
edges |
a tibble or data frame for edge attributes |
nodes |
a tibble or data frame for node attributes. It can be NULL |
directed |
a logic specifying whether to create a directed graph. By default it is false |
intersected |
a logic or NULL specifying whether to restrict to only the intersected vertices (from input nodes and edges). By default it is NULL; it will be forced true (if the input nodes do not contain all vertices in the input edges); however, the input nodes can contain vertices not in the input edges. It only works when the input nodes are not NULL |
an igraph object
none
xTB2IG
set.seed(825) ig <- sample_pa(20) V(ig)$name <- seq(1,vcount(ig)) ig %>% xIG2TB('edges') -> edges ig %>% xIG2TB('nodes') -> nodes xTB2IG(edges, nodes) -> g # nodes do not cointain all vertices in the edges nodes[1:10,] -> nodes2 xTB2IG(edges, nodes2) -> g2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.