object: An object representing a graph. Valid objects are an adjacency matrix or an igraph.
getv: The result is by default a list of vectors of the form (v, pa1, pa2, ... paN) where pa1, pa2, ... paN
are the parents of v. If getv is FALSE
then the vectors will have the form (pa1, pa2, ... paN)
forceCheck: Logical indicating if it should be checked that the object is a DAG.
Returns
A list of vectors where each vector will have the form (v, pa1, pa2, ... paN) where pa1, pa2, ... paN
are the parents of v.
Examples
## DAGsdag_mat <- dag(~a:b:c + c:d:e, result="matrix")dag_ig <- dag(~a:b:c + c:d:e)vpar(dag_mat)vpar(dag_ig)vpar(dag_mat, getv=FALSE)vpar(dag_ig, getv=FALSE)## Undirected graphsug_mat <- ug(~a:b:c + c:d:e, result="matrix")ug_ig <- ug(~a:b:c + c:d:e)## Not run:## This will fail because the adjacency matrix is symmetric and the## graph has undirected edgesvpar(ug_mat)vpar(ug_ig)## End(Not run)## When forceCheck is FALSE, it will not be detected that the#g raphs are undirected.vpar(ug_mat, forceCheck=FALSE)vpar(ug_ig, forceCheck=FALSE)