search for: theoreticalnewtree

Displaying 1 result from an estimated 1 matches for "theoreticalnewtree".

2011 Aug 19
1
gsub for numeric characters in string
...s preceded with a name (because there are internal nodes in the tree structure). > tree [1] "(*1*:328,((*5*:154,*2*:135):147,(*3*:30,*4*:50):252):45);" I would like to replace the length with the lengthplusstate in the tree, while removing the names, so that it looks like this: > theoreticalnewtree [1] "(*1*:328,((*1*:154,*4*:135)NA:147,(*3*:30,*2*:50)NA:252)NA:45);" I am using this code: > for (j in all) newtree <- gsub(ln[j], lnplusstate[j], tree) However, I end up with this: > newtree [1] "(*11*:328,((*51*:154,*24*:135)NA:147,(*33*:30,*42*:50)NA:252...