#' identify nodes of a monophyletic clade
#'
#' identify nodes of a monophyletic clade
#' @param phylo dated tree in ape format
#' @param node
#' @keywords
#' @return storeNodes
#' @export
#' @examples
#' monoClade()
monoClade <- function(phylo, node) {
tips <- Ntip(phylo)
nextNodes <- node
storeNodes <- nextNodes
stopPoint <- FALSE
while(stopPoint == FALSE) {
startPoints <- unlist(sapply(nextNodes, function(x) which(phylo$edge[,1] == x)))
nextNodes <- phylo$edge[startPoints, 2]
storeNodes <- c(storeNodes, nextNodes)
stopPoint <- all(nextNodes <= tips)
}
return(storeNodes)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.