Displaying 1 result from an estimated 1 matches for "lnplusstate".
Did you mean:
lenplusstate
2011 Aug 19
1
gsub for numeric characters in string
...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)NA:45);"
that is, I have not removed the names from the string so that now the state
information is wrong.
If anyone can help with the proper code to get rid of the n...