iplotPC | R Documentation |
Notably, when the Rgraphviz package is not easily available,
iplotPC()
is an alternative for plotting a "pcAlgo"
object,
making use of package igraph.
It extracts the adjacency matrix and converts it into an object from package igraph which is then plotted.
iplotPC(pc.fit, labels = NULL)
pc.fit |
an R object of class |
labels |
optional labels for nodes; by default, the labels from
the |
Nothing. As side effect, the plot of pcAlgo object pc.fit
.
Note that this function does not work on fciAlgo
objects, as those need different edge marks.
Markus Kalisch kalisch@stat.math.ethz.ch
showEdgeList
for printing the edge list of a
pcAlgo
object; showAmat
for
printing the adjacency matrix of a pcAlgo object.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.