Transform the adjacency matrix from pcalg into a dagitty object
Transform the adjacency matrix of type amat.cpdag or
amat.pag (for details on coding see amatType).
pcalg2dagitty(amat, labels, type = "cpdag")
amat |
adjacency matrix of type |
labels |
|
type |
string specifying the type of graph of the adjacency matrix |
For a given adjacency matrix amat the form amat.cpdag or amat.pag and a specified graph type, this function returns a dagitty object corresponding to the graph structure specified by amat, labels and type.
The resulting object is compatible with the dagitty package.
A dagitty graph (see the dagitty package).
Emilija Perkovic and Markus Kalisch
data(gmG)
n <- nrow (gmG8$x)
V <- colnames(gmG8$x) # labels aka node names
amat <- wgtMatrix(gmG8$g)
amat[amat != 0] <- 1
if(requireNamespace("dagitty", quietly = TRUE)) {
dagitty_dag1 <- pcalg2dagitty(amat,V,type="dag")
}Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.