R Under development (unstable) (2024-09-06 r87103 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(pcalg) > suppressWarnings(RNGversion("3.5.0")) > set.seed(123) > > ## expl 1 > g1 <- randomDAG(5,0.5) > g2 <- randomDAG(5,0.5) > res1 <- (shd(g1,g2)==4) > > ## expl 2 > g3 <- dag2cpdag(g1) > res2 <- (shd(g3,g1)==3) > > if(!all(c(res1,res2))) { + stop("Test of shd: Theoretical value not matched!") + } > > proc.time() user system elapsed 0.82 0.12 0.93