graphrescheck {causaloptim} | R Documentation |
Check conditions on digraph
Description
Check that a given digraph satisfies the conditions of 'no left to right edges', 'no cycles', 'valid number of categories' and 'valid variable names'. Optionally returns the digraph if all checks are passed.
Usage
graphrescheck(graphres, ret = FALSE)
Arguments
graphres |
An |
ret |
A logical value. Default is |
Value
If ret=FALSE
(default): TRUE
if all checks pass; else FALSE
.
If ret=TRUE
: graphres
if all checks pass; else FALSE
.
Examples
graphres <- graph_from_literal(X -+ Y, X -+ M, M -+ Y, Ul -+ X, Ur -+ M, Ur -+ Y)
V(graphres)$leftside <- c(1, 0, 0, 1, 0)
V(graphres)$latent <- c(0, 0, 0, 1, 1)
V(graphres)$nvals <- c(2, 2, 2, 2, 2)
V(graphres)$exposure <- c(0, 0, 0, 0, 0)
V(graphres)$outcome <- c(0, 0, 0, 0, 0)
E(graphres)$rlconnect <- c(0, 0, 0, 0, 0, 0)
E(graphres)$edge.monotone <- c(0, 0, 0, 0, 0, 0)
graphrescheck(graphres = graphres) # TRUE
[Package causaloptim version 0.9.8 Index]