search for: lengthplusst

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

2011 Aug 19
1
gsub for numeric characters in string
...the colon), and the name of each item (1-5) precedes a colon. However, not every colon is 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...