A recent Google search string that led a user to the phytools blog was as follows:
"how to create newick tree without distances"
By this I presume they mean: how does one print a Newick tree to file (or screen) without branch lengths? In R, this is very straightforward.
Every phylo object stored in memory has three main items and a class attribute "phylo". The items are a m × 2 matrix edge (for m branches in the tree); a vector of length N containing all the tip names (tip.label); and an integer, Nnode, which indicates the number of internal nodes in the tree. Trees with branch lengths also have an m length vector edge.length containing the branch lengths for all the branches in the tree (in the same order as the rows in edge).
To print a tree without its branch lengths, it is simply necessary to set edge.length to NULL. That's it - piece of cake, right?
Let's try it.
> tr1<-rtree(10) # random tree
> write.tree(tr1) # write tree with edge lengths
> tr2<-tr1 # copy tree
> tr2$edge.length<-NULL # get rid of edge lengths
> write.tree(tr2) # write tree without edge lengths
Of course, this works just as well with write.nexus (which writes a NEXUS format tree) or write.tree(...,file=filename) and write.nexus(...,file=filename).