It looks like the NEXUS file might be badly conformed.

You could try:

obj<-scan(file="TimetreeOfLife2015.tre",n=1,skip=2,what="character")
tree<-read.tree(text=obj)

That seemed to work for me.

- Liam

Liam J. Revell, Associate Professor of Biology
University of Massachusetts Boston
web: http://faculty.umb.edu/liam.revell/
email: liam.rev...@umb.edu
blog: http://blog.phytools.org

On 5/23/2016 12:11 PM, Sergio Ferreira Cardoso wrote:
Dear all,

I am trying to open a .tre file with ape. I downloaded the tree from
http://www.timetree.org/book#treefiles. It's a .tre (not .nex) file, but
it's essentially a nexus. I tried to open it:

tr <- read.nexus(file="TimetreeOfLife2015.tre")
Error in trees[[i]] : subscript out of bounds

I tried to change the file name to .nex, but it wouldn't work. I saw some
previous threads but I couldn't solve the problem.
Does anyone know how can I solve this?

Thanks in advance,
Sérgio.

ps: I have the lastest 3.4 version of ape.


_______________________________________________
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/

Reply via email to