## Load predefined data
data(gmG)
n <- nrow (gmG8$x)
V <- colnames(gmG8$x)
## define sufficient statistics
suffStat <- list(C = cor(gmG8$x), n = n)
## estimate CPDAG
pc.fit <- pc(suffStat, indepTest = gaussCItest,
alpha = 0.01, labels = V, verbose = TRUE)
## Edge list
showEdgeList(pc.fit)
## Adjacency matrix
showAmat(pc.fit)
## Plot using package igraph; show estimated CPDAG:
iplotPC(pc.fit)
Run the code above in your browser using DataLab