graph_vpar | R Documentation |
Get list of vertices and their parents for graph.
vchi(object, getv = TRUE, forceCheck = TRUE)
vchiMAT(object, getv = TRUE, forceCheck = TRUE)
vpar(object, getv = TRUE, forceCheck = TRUE)
vparMAT(object, getv = TRUE, forceCheck = TRUE)
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
|
forceCheck |
Logical indicating if it should be checked that the object is a DAG. |
A list of vectors where each vector will have the form
(v, pa1, pa2, ... paN)
where pa1, pa2, ... paN
are the parents of v
.
dag
, ug
## DAGs
dag_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 graphs
ug_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 edges
vpar(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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.