c_net_ego: Extract ego-centric subnetwork with preserved class...

View source: R/8.net_compare.R

c_net_egoR Documentation

Extract ego-centric subnetwork with preserved class attributes

Description

Wrapper around igraph::make_ego_graph() that ensures output retains "metanet" and "igraph" class structure. Supports single or multiple center nodes.

Usage

c_net_ego(graph, nodes, order = 1, mode = "all")

Arguments

graph

An igraph object with potential "metanet" class

nodes

Center node(s) for subnetwork extraction (vertex IDs or names)

order

Integer specifying the order of neighbors to include

mode

Character scalar, either "in", "out" or "all" for directed networks

Value

metanet

Examples

library(igraph)
c_net_plot(co_net)
c_net_plot(c_net_ego(co_net, "s__Kribbella_catacumbae"))
nodes <- c("s__Kribbella_catacumbae", "s__Verrucosispora_andamanensis")
c_net_plot(c_net_ego(co_net, nodes))

MetaNet documentation built on June 26, 2025, 5:07 p.m.