select_top: Select Top N Nodes by Centrality

View source: R/network-utils.R

select_topR Documentation

Select Top N Nodes by Centrality

Description

Select the top N nodes ranked by a centrality measure.

Usage

select_top(
  x,
  n,
  by = "degree",
  ...,
  keep_edges = c("internal", "none"),
  keep_format = FALSE,
  directed = NULL
)

Arguments

x

Network input.

n

Integer. Number of top nodes to select.

by

Character. Centrality measure for ranking: "degree", "indegree", "outdegree", "strength", "instrength", "outstrength", "betweenness", "closeness", "eigenvector", "pagerank", "hub", "authority", "coreness", or the name of any other measure centrality() computes (see list_centralities()). An unknown name raises a cograph_bad_selection error. Default "degree".

...

Additional filter expressions, applied after the top n nodes are selected.

keep_edges

How to handle edges. Default "internal".

keep_format

Logical. Keep input format? Default FALSE.

directed

Logical or NULL. Auto-detect if NULL.

Value

A cograph_network with the top N nodes.

See Also

select_nodes, select_component

Examples

select_top(regulation_net, n = 3, by = "pagerank")

cograph documentation built on Nov. 19, 2026, 5:07 p.m.