node_get_nbs {sfdep} | R Documentation |
Create node features from edges
Description
Given a tidygraph object, create a list column of edge data for each node in the node context.
Usage
node_get_nbs()
node_get_edge_list()
node_get_edge_col(edges, .var)
Arguments
edges |
an edge list as created by |
.var |
the quoted name of a column in the edge context. |
Details
-
node_get_nbs()
: creates a neighbor list in the nodes context based on the adjacency list. This returns anb
class object with the neighboring nodes.Uses
igraph::get.adjlist()
-
node_get_edge_list()
: creates an edge list. The edge list contains the row index of the edge relationships in the edge context for each node.Uses
igraph::get.adjedgelist()
.
-
node_get_edge_col()
: creates a list column containing edge attributes as a list column in the node context (much likefind_xj()
).Uses
igraph::get.edge.attribute()
Value
A list column
Examples
if (interactive()) {
net <- sfnetworks::as_sfnetwork(
sfnetworks::roxel
)
dplyr::mutate(
net,
nb = node_get_nbs(),
edges = node_get_edge_list(),
types = node_get_edge_col(edges, "type")
)
}
[Package sfdep version 0.2.4 Index]