View source: R/graph-functions.R
findQ | R Documentation |
For all subsets of size 4 of the observed nodes of a tree, the function determines if a subset is an element of Q or not.
findQ(g, m, nr = NULL)
g |
An igraph object that is a tree. It is assumed that the first m nodes correspond to observed nodes. |
m |
Integer, number of observed nodes. |
nr |
Integer, number of subsets that are considered. Note that this is optional. If |
A list with two entries is returned. Both entries are matrices with 4 columns. The first matrix are all subsets that belong to Q, the second are all subsets that do not belong to Q. Each row represents one subset. For the matrix Q the order of the elements in a row is important. A row with entries p,q,r,s means that the element p,q|r,s is in Q.
vertices <- data.frame(name=seq(1,8), type=c(rep(1,5), rep(2,3))) # 1=observed, 2=latent
edges <- data.frame(from=c(1,2,3,4,5,6,7), to=c(8,8,6,6,7,7,8))
tree <- igraph::graph_from_data_frame(edges, directed=FALSE, vertices=vertices)
plot(tree)
findQ(tree, 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.