Hi Lev,

  I recently released a package that is robust to reading trees that
includes singletons by relying on the NEXUS class library. It can read
newick files.

  The package is on CRAN here:
http://cran.r-project.org/web/packages/rncl/index.html after
installation:

library(rncl)
read_newick_phylo(file="tree.tre")

  Cheers,
  -- François



On Tue, Feb 17, 2015 at 2:19 PM, Yampolsky, Lev <yampo...@mail.etsu.edu> wrote:
> Dear Colleagues,
>
> I need to remove singleton nodes from a tree; trying to do it by this script:
>
> require(phytools)
> source("read.newick.R")
> tree<-read.newick(file="tree,tre")
> tree<-collapse.singles(tree)
> plotTree(tree,type="fan")
>
> (https://stat.ethz.ch/pipermail/r-sig-phylo/2013-June/002783.html)
>
> read.newick.R returns warnings that look like this:
> 1: In getEdgeLength(text, i) : NAs introduced by coercion
> (and then the same for every node).
> And of course the resulting tree has 0 edge lengths.
>
> Anyone has any idea why this may be happening?
>
> Thank you very much in advance,
>
> Lev Yampolsky
>
> _______________________________________________
> 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/

_______________________________________________
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