tests/phylosubtest.R

library(phylobase)
library(ape)
data(geospiza)

gtree <- extractTree(geospiza)
stopifnot(identical(gtree,prune(gtree,character(0))))

stopifnot(identical(tdata(subset(geospiza)),
                    tdata(subset(geospiza, tipLabels(geospiza)))))


tr <- read.tree(text="(((spA:0.2,(spB:0.1,spC:0.1):0.15):0.5,spD:0.7):0.2,spE:1):0.4;")
phyd <- as(tr, "phylo4d")
tipData(phyd) <- 1:5
stopifnot(identical(phyd@data,subset(phyd,tipLabels(phyd))@data))

Try the phylobase package in your browser

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

phylobase documentation built on May 2, 2019, 6:49 p.m.