f.district: Get the district of a vertex in a graph.

View source: R/graph-functions.R

f.districtR Documentation

Get the district of a vertex in a graph.

Description

Function to extract the name of vertices that is in the district of a given vertex in a graph object. District of a unfixed vertex Vi is the set of vertices that are connected to Vi by bidirected edges, including Vi itself by convention.

Usage

f.district(graph, node)

Arguments

graph

A graph object generated by the make.graph() function.

node

A character string of a vertex for which to extract district.

Value

A vector of vertices that is in the district of the given vertex.

Examples

graph <- make.graph(vertices=c('A','M','L','Y','X'),
bi_edges=list(c('A','Y')),
di_edges=list(c('X','A'), c('X','M'), c('X','L'),
c('X','Y'), c('M','Y'), c('A','M'), c('A','L'), c('M','L'), c('L','Y')))
f.district(graph, c('A'))


flexCausal documentation built on March 29, 2026, 5:08 p.m.