isAcyclic: Test for Cycles

Description Usage Arguments Details Examples

View source: R/dagitty.r

Description

Returns TRUE if the given graph does not contain a directed cycle.

Usage

1

Arguments

x

the input graph, of any graph type.

Details

This function will only consider simple directed edges in the given graph.

Examples

1
2
3
4
5
6
g1 <- dagitty("dag{X -> Y -> Z}")
stopifnot( isTRUE(isAcyclic( g1 )) )
g2 <- dagitty("dag{X -> Y -> Z -> X}")
stopifnot( isTRUE(!isAcyclic( g2 )) )
g3 <- dagitty("mag{X -- Y -- Z -- X}")
stopifnot( isTRUE(isAcyclic( g3 )) )

Example output



dagitty documentation built on Jan. 21, 2021, 5:07 p.m.