Skip to contents

ego_netlet extracts ego networks from a given 'netify' object. An ego network is the subgraph consisting of a focal node (ego) and its immediate neighbors (alters) in the context of an unweighted network. For weighted networks, users can choose a threshold to define the neighborhood of the ego. The function returns a list of 'netify' objects, each representing an ego network. For oders of the neighborhood greater than 1, we recommend the ego function from the 'igraph' package.

Usage

ego_netlet(
  netlet,
  ego,
  threshold = NULL,
  ngbd_direction = "any",
  include_ego = TRUE
)

Arguments

netlet

A 'netify' object

ego

A character vector specifying the name(s) of the ego(s) for whom to create the ego networks.

threshold

A numeric value or vector specifying the threshold for including alters in the ego network. The threshold is used to define the neighborhood of the ego in weighted networks. If a vector is provided, its length should correspond to the number of time points, allowing for a different threshold to be applied for each time period. For unweighted networks, the default is 0. For weighted networks, the default is the average edge weight.

ngbd_direction

For directed networks users can provide a character string specifying the type of relationship that the ego should have with alters to be considered neighbors. Options are that the neighborhood for an ego will be alters that it has an outgoing tie with ("out"), incoming tie from ("in"), or any tie ("any"). Default is "any".

include_ego

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

Value

A list of 'netify' objects, each representing an ego network.

Author

Cassy Dorff, Shahryar Minhas