retain.groups: Edge Subsets

View source: R/Community.R

retain.groupsR Documentation

Edge Subsets

Description

Subset an edge list

Usage

retain.groups(edges, groups)

retain.nodes(edges, nodes)

Arguments

edges

an edge list

groups

the groups to retain in the subset

nodes

the nodes to retain in the subset

Details

These functions extract a subset of an edge list containing only edges in a specified group, or incident with a specified set of nodes.

Value

retain.groups returns an edge list containing only edges from the specified groups.

retain.nodes returns an edge list containing only edges incident on the specified nodes.

Examples

edges <- parse.digraph(c("A *-> B","B *-> C","C *--> D"))
write.digraph(retain.groups(edges,c(0)))

SWotherspoon/QPress documentation built on Sept. 26, 2022, 2:27 a.m.