Compute degree count stratified by node type using either an edge list or neighbor reference object computed by get_neighbor_list().

search_degrees(
  root,
  type = NA,
  reference_list,
  list_type = c("edge", "neighbor"),
  consider_edge_type = TRUE
)

Arguments

root

ID of the root node.

type

Desired type of the neighbors.

reference_list

Either an edge list as a data.table or a neighbor reference object constructed by get_neighbor_list(). If an edge list is provided, the data.table must contain the following columns:

Origin

IDs of the origin nodes for each edge.

Destination

IDs of the destination nodes for each edge.

OriginType

Types of the origin node for each edge.

DestinationType

Types of the destination node for each edge.

EdgeType

Types of each edge.

list_type

If an edge list is provided, specify "edge". If a neighbor list is provided, specify "neighbor".

consider_edge_type

Should EdgeType be considered in the degree calculation? Only possible when using a edge list (i.e., list_type is "edge") rather than a neighbor list.

Value

Degree count stratified by type.

See also

get_neighbor_list() for neighbor reference object construction.