Skip to contents

get_ngbd_net_for_ego extracts the neighborhood network for a specified ego from a given list of raw networks. It allows the user to define the neighborhood based on outgoing, incoming, or any relationship, and includes a threshold for weighted networks.

Usage

get_ngbd_net_for_ego(
  raw_net,
  ego,
  threshold,
  include_ego = TRUE,
  ngbd_direction = "any"
)

Arguments

raw_net

A list of raw network matrices.

ego

A character vector specifying the name of the ego for whom to create the neighborhood network.

threshold

A numeric vector specifying the threshold for including alters in the neighborhood network. Default for unweighted networks is 0 and default for weighted networks is the average edge weight.

include_ego

Logical; if TRUE, the ego node will be included in the neighborhood network. Default is TRUE.

ngbd_direction

A character string specifying the type of relationship to consider for directed networks. Options are "out" for outgoing ties, "in" for incoming ties, and "any" for any relationship. Default is "any".

Value

A list of neighborhood networks, each represented as a matrix.

Author

Cassy Dorff, Shahryar Minhas