R/is.dag.R

Defines functions is.dag

Documented in is.dag

is.dag <- function(dag) {
  if ( any( dag == 2 ) ) {
    dag[ dag != 2 ] <- 0
    dag[ dag == 2 ] <- 1
  } 
  a <- Rfast::topological_sort(dag)
  any( !is.na(a) )
} 
       
     
  
  

Try the MXM package in your browser

Any scripts or data that you put into this service are public.

MXM documentation built on Aug. 25, 2022, 9:05 a.m.