Hello all I am working with a cophylogenetic problem where I have a host tree, a parasite tree and a binary matrix HP encapsulating the host-parasite associations . After trimming the matrix according to a given criterion, I require to prune the trees accordingly. Since I am getting errors at the execution I devised the following control function to check the number of tree nodes after pruning: z <- function (hp, treeH,treeP) {treeh <- drop.tip(treeH, setdiff(treeH$tip.label, rownames(hp))) treep <- drop.tip(treeP, setdiff(treeP$tip.label, colnames(hp))) res <- c(treeh$Nnode,treep$Nnode) return(res) } Then I try the following x <- sapply (THP, z, treeH=TreeH[[7]], treeP= TreeP[[7]]) where THP is a list of trimmed HP matrices and TreeH and TreeP are multiphylo objects and get the following error: Error in integer(max(oldnodes)) : vector size cannot be infinite The traceback is 6. integer(max(oldnodes)) This error appears only with this particular pair of host and parasite trees (#7) and I cannot find a reason why this case should be different. Any help will be very much appreciated. Juan A. Balbuena --
Dr.
Juan
A. Balbuena |
_______________________________________________ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/