R/common_tips.r

Defines functions common_tips

Documented in common_tips

#' Find shared tip labels
#'
#' Find shared tip labels of a collection of trees.
#' This function is useful when pruning a collection
#' of related trees to a trees of same size and taxa.
#'
#' @param x a collection of trees of class "multiPhylo"
#' @return intersection of tip labels across all trees
#'
#' @examples
#' trees = rankedPhylo(3:7)
#' common_tips(trees)
#'
#' @export
common_tips = function(x){
    tips = tips(x, all = TRUE)
    tips = Reduce(intersect, tips)
    tips
    }

Try the rrnni package in your browser

Any scripts or data that you put into this service are public.

rrnni documentation built on Aug. 25, 2023, 5:16 p.m.