View source: R/getFactoredEdges.R
getFactoredEdges | R Documentation |
Returns edges from a phylofactor
getFactoredEdges(v = NULL, tree, M = NULL, grp1 = NULL,
grp2 = NULL)
v |
Optional input of an ILR-style partition vector, which automatically extracts grp1 and grp2 |
tree |
Phylo object |
M |
Most recent common ancestor matrix of |
grp1 |
Vector of the indexes for tips contained in group1 (also the nodes corresponding to the tips in group1) |
grp2 |
same as grp1, but must be a disjoint group from grp1. |
#Case 1: mrca1>root:
set.seed(1)
tree <- rtree(12)
grp1 <- c(9:12)
grp2 <- c(1:8) #correct answer: 16
getFactoredEdges(tree=tree,grp1=grp1,grp2=grp2)
#Case 2: mrca2>root:
grp1 <- c(1:8)
grp2 <- c(9:12) #correct answer:16
getFactoredEdges(tree=tree,grp1=grp1,grp2=grp2)
grp1 <- c(1:8,12)
grp2 <- c(9:11) #correct answer: 17
getFactoredEdges(tree=tree,grp1=grp1,grp2=grp2)
#Case 3: mrca1>root & mrca2 >root - nodepath passing trough root
grp1 <- c(9:11)
grp2 <- c(2:3) #correct answer: c(17,16,6,1,3)
getFactoredEdges(tree=tree,grp1=grp1,grp2=grp2)
#Case 4: mrca1>root & mrca2 >root - nodepath NOT passing trough root
grp1 <- c(9:11)
grp2 <- c(5,6) #correct answer: c(17,16,7,8,10,11)
getFactoredEdges(tree=tree,grp1=grp1,grp2=grp2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.