R/getEdges.r

Defines functions getEdges

Documented in getEdges

#' List all edges descendant from a node
#'
#' @param tree an object of class 'phylo'.
#' @param node number of interest.
#' @return vector of edge numbers.

#' @export

getEdges<-function(tree,node){
      Desc<-getDescendants(tree,node)
      Edges<-c()
      for(i in 1:length(Desc)){Edges<-c(Edges,which(tree$edge[,2]==Desc[i]))}
      Edges<-c(Edges,which(tree$edge[,2]==node))
      return(Edges)}
      
JeroenSmaers/evomap documentation built on May 7, 2019, 10:35 a.m.