Klaus and Others- I tried reorder(), cladewise and pruningwise, and both methods produced a new error message when I tried bind.tree().
> chosen_tree<-bind.tree(ct2,clade,where=tip) Error in if (where == 0 || where == "root") where <- ROOTx : missing value where TRUE/FALSE needed -Dave On Tue, Mar 8, 2011 at 5:28 PM, Klaus Schliep <klaus.schl...@gmail.com> wrote: > Hi David, > > have you checked the ordering of the trees? allTrees returns trees in > ''pruningwise" ordering. Different functions assume different things > how this should look like, but often don't say it explicitely. Things > like reorder from ape or phangorn:::reorderPruning (a bit faster) are > generally a much faster alternative for read.tree(write.tree(...)), > even this got also faster recently. > > Cheers, > Klaus > > On 3/8/11, David Bapst <dwba...@uchicago.edu> wrote: >> Hello all, >> >> Apologies for sending another post this week, but I've run into a >> strange error with bind.tree(), as below. I'm binding one tree >> ("clade") to a tip (4, in this case) on another tree ("chosen_tree"). >> "chosen_tree" is a tree from an allTrees() output. >> >>> bind.tree(chosen_tree,clade,where=tip) >> Error in x$edge[sndcol, 2] <- newNb[-x$edge[sndcol, 2]] <- (n + 2):(n + : >> number of items to replace is not a multiple of replacement length >> In addition: Warning message: >> In newNb[-x$edge[sndcol, 2]] <- (n + 2):(n + x$Nnode) : >> number of items to replace is not a multiple of replacement length >> >> Bizarrely, while trying to create sample files for you to test, I >> found that write.tree() and read.tree() actually get rid of the >> problem, and furthermore, that the problem is with "chosen_tree" and >> not "clade". So, as of the moment, I'm unfortunately unable to make >> the error reproducible. Not all trees from an allTrees output do this, >> either. >> >>> bind.tree(chosen_tree,read.tree(text=write.tree(clade,file="")),where=tip) >> Error in x$edge[sndcol, 2] <- newNb[-x$edge[sndcol, 2]] <- (n + 2):(n + : >> number of items to replace is not a multiple of replacement length >> In addition: Warning message: >> In newNb[-x$edge[sndcol, 2]] <- (n + 2):(n + x$Nnode) : >> number of items to replace is not a multiple of replacement length >>> bind.tree(read.tree(text=write.tree(chosen_tree,file="")),clade,where=tip) >> Phylogenetic tree with 5 tips and 4 internal nodes. >> Tip labels: >> [1] "1781" "23" "24" "GR1210" "GR3799" >> Rooted; no branch lengths. >> >> Anyone have any idea what's going on? For now, I'll solve it by using >> the read.tree(write.tree()) kludge. >> -Dave >> >> >> -- >> David Bapst >> Dept of Geophysical Sciences >> University of Chicago >> 5734 S. Ellis >> Chicago, IL 60637 >> http://home.uchicago.edu/~dwbapst/ >> >> _______________________________________________ >> R-sig-phylo mailing list >> R-sig-phylo@r-project.org >> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo >> > > > -- > Klaus Schliep > Université Paris 6 (Pierre et Marie Curie) > 9, Quai Saint-Bernard, 75005 Paris > -- David Bapst Dept of Geophysical Sciences University of Chicago 5734 S. Ellis Chicago, IL 60637 http://home.uchicago.edu/~dwbapst/ _______________________________________________ R-sig-phylo mailing list R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo