listDD: List direct descendants for all nodes of a tree

Description Usage Arguments Value Author(s) See Also Examples

View source: R/utils.R

Description

The function listDD lists the direct descendants from each node of a tree. The tree can be of class phylo, phylo4 or phylo4d.

Usage

1
listDD(x, nameBy=c("label","number"))

Arguments

x

A tree of class phylo, phylo4 or phylo4d.

nameBy

a character string indicating whether the returned list must be named by node labels ("label") or by node numbers ("number").

Value

A list whose components are vectors of named nodes (or tips) for a given internal node.

Author(s)

Thibaut Jombart tjombart@imperial.ac.uk

See Also

listTips which lists the tips descending from each node.

treePart which defines partitions of tips according to the tree topology.

Examples

1
2
3
4
5
6
if(require(ape) & require(phylobase)){
## make a tree
x <- as(rtree(20),"phylo4")
plot(x,show.node=TRUE)
listDD(x)
}

Example output

Loading required package: ade4
Registered S3 method overwritten by 'spdep':
  method   from
  plot.mst ape 
Loading required package: ape
Loading required package: phylobase

Attaching package:phylobaseThe following object is masked frompackage:ape:

    edges

$`21`
<NA> <NA> 
  22   27 

$`22`
<NA> <NA> 
  23   25 

$`23`
  t4 <NA> 
   1   24 

$`24`
t13 t18 
  2   3 

$`25`
 t17 <NA> 
   6   26 

$`26`
 t6 t12 
  4   5 

$`27`
<NA> <NA> 
  28   32 

$`28`
<NA> <NA> 
  29   31 

$`29`
  t5 <NA> 
   7   30 

$`30`
t1 t2 
 8  9 

$`31`
t19 t14 
 10  11 

$`32`
  t8 <NA> 
  20   33 

$`33`
<NA> <NA> 
  34   37 

$`34`
 t10 <NA> 
  15   35 

$`35`
 t15 <NA> 
  14   36 

$`36`
 t7 t20 
 12  13 

$`37`
<NA> <NA> 
  38   39 

$`38`
t9 t3 
16 17 

$`39`
t11 t16 
 18  19 

adephylo documentation built on May 2, 2019, 4:54 p.m.