f.top_order: Get the topological ordering of a graph from a graph object.

View source: R/graph-functions.R

f.top_orderR Documentation

Get the topological ordering of a graph from a graph object.

Description

Wrapper around f.top_orderMAT() that first builds the adjacency matrix from the graph.

Usage

f.top_order(graph, treatment = NULL)

Arguments

graph

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

treatment

A character string indicating the treatment variable. If NULL, this function will rank vertices according to their input order in the vertices vector when there are ties.

Value

A vector of vertices ranked with rank from small to large.

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.top_order(graph)


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