as_adj_list | R Documentation |
Create adjacency lists from a graph, either for adjacent edges or for neighboring vertices
as_adj_list(
graph,
mode = c("all", "out", "in", "total"),
loops = c("twice", "once", "ignore"),
multiple = TRUE
)
as_adj_edge_list(
graph,
mode = c("all", "out", "in", "total"),
loops = c("twice", "once", "ignore")
)
graph |
The input graph. |
mode |
Character scalar, it gives what kind of adjacent edges/vertices
to include in the lists. ‘ |
loops |
Character scalar, one of |
multiple |
Logical scalar, set to |
as_adj_list()
returns a list of numeric vectors, which include the ids
of neighbor vertices (according to the mode
argument) of all
vertices.
as_adj_edge_list()
returns a list of numeric vectors, which include the
ids of adjacent edges (according to the mode
argument) of all
vertices.
If igraph_opt("return.vs.es")
is true (default), the numeric
vectors of the adjacency lists are coerced to igraph.vs
, this can be
a very expensive operation on large graphs.
A list of igraph.vs
or a list of numeric vectors depending on
the value of igraph_opt("return.vs.es")
, see details for performance
characteristics.
Gabor Csardi csardi.gabor@gmail.com
as_edgelist()
, as_adjacency_matrix()
Other conversion:
as.matrix.igraph()
,
as_adjacency_matrix()
,
as_biadjacency_matrix()
,
as_data_frame()
,
as_directed()
,
as_edgelist()
,
as_graphnel()
,
as_long_data_frame()
,
graph_from_adj_list()
,
graph_from_graphnel()
g <- make_ring(10)
as_adj_list(g)
as_adj_edge_list(g)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.