For a given set of root nodes, step along a given meta-path to find their neighbors using either get_neighbors() (for edge lists) or search_neighbors() (for neighbor lists).

map_neighbors(
  roots_subset,
  current_mp,
  next_mp,
  reference_list,
  list_type = c("edge", "neighbor")
)

Arguments

roots_subset

Paths from a specific root node as a data.table.

current_mp

Label of the current type along the meta-path.

next_mp

Label of the next type along the meta-path.

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".

Value

Neighbors of the root nodes of a specified type (along the meta-path) as a data.table.

See also

get_neighbor_list() for neighbor reference object construction.