Hi Anna, I can read your tree using the package phylobase:
tr <- readNexus(file="IndTree.nex") If you need it in the phylo format to use with other functions in ape, you can convert it with: as(tr, "phylo") cheers, -- François On Fri, Aug 15, 2014 at 9:56 AM, Anna Bastian <anna.bast...@uct.ac.za> wrote: > Dear list members, > > > > I am trying to read a tree into R (‘ape’ package). I downloaded the latest > versions. > > > > The tree has many polytomies and that might be the problem. > > It contains ten species and each species contains of a different number of > individuals (those are the polytomies). > > I attached it here. > > > > I tried read.nexus > > …and get: Error in trees[[i]] : subscript out of bounds > > > > I tried read.tree #using a newick format for the tree) > > …and get: Error in if (tp[3] != "") obj$node.label <- tp[3] : > > missing value where TRUE/FALSE needed > > > > I came across a “Robust Newick tree reader” by Liam Revell and tied the > code he provides (http://www.phytools.org/read.newick/v0.5/read.newick.R) > but I can’t make it work. > > > > > > Can somebody get the tree into R? > > > > Please let me know if you know what’s wrong > > > > Thanks a lot > > > > Anna > > > > > > ** * * * * * * * * * * * > > *University of Cape Town* > *Animal Evolution and Systematics Group* > > Department of Biological Sciences > Room 3.32 > > Tel: +27 (0)21 6502405 > > Fax: +27 (0)21 6502718 > > > ------------------------------ > UNIVERSITY OF CAPE TOWN > > This e-mail is subject to the UCT ICT policies and e-mail disclaimer > published on our website at > http://www.uct.ac.za/about/policies/emaildisclaimer/ or obtainable from +27 > 21 650 9111. This e-mail is intended only for the person(s) to whom it is > addressed. If the e-mail has reached you in error, please notify the > author. If you are not the intended recipient of the e-mail you may not > use, disclose, copy, redirect or print the content. If this e-mail is not > related to the business of UCT it is sent by the sender in the sender's > individual capacity. > > _______________________________________________ > 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/ > [[alternative HTML version deleted]] _______________________________________________ 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/