remove_nodes: Remove Nodes from a Network

View source: R/wrangle-edit.R

remove_nodesR Documentation

Remove Nodes from a Network

Description

Deletes nodes and every edge incident to them. A node that is not in the network raises a cograph_bad_selection error.

Usage

remove_nodes(x, nodes, keep_format = FALSE, directed = NULL)

Arguments

x

Network input.

nodes

Node labels or indices to remove.

keep_format

Logical. Return the input format when TRUE.

directed

Logical or NULL. If NULL (default), auto-detect.

Value

A cograph_network without those nodes and without any edge that touched them, or the input format when keep_format = TRUE.

See Also

add_nodes, filter_nodes, remove_isolates

Examples

remove_nodes(regulation_net, nodes = "Share")

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