Re: [R] Data parsing question: adding characters within a string of characters

2014-01-02 Thread Frede Aakmann Tøgersen
Hi Joshua This is one way to do it. Not sure if it this is an efficient implementation for your needs; it depends on the size of your data. string1 <- "ATCGCCCGTA[AGA]TAACCG" string2 <- "ATTATACGCA[AAATGA]GCTA[AT]GCATTA" foo <- function(genes){ mypaste <- function(x) paste("[", paste(

Re: [R] Data parsing question: adding characters within a string of characters

2014-01-02 Thread Gabor Grothendieck
On Wed, Jan 1, 2014 at 10:55 PM, Joshua Banta wrote: > Dear Listserve, > > I have a data-parsing question for you. I recognize this is more in the > domain of PERL/Python, but I don't know those languages! On the other hand, I > am pretty good overall with R, so I'd rather get the job done withi

Re: [R] Data parsing question: adding characters within a string of characters

2014-01-02 Thread Duncan Murdoch
On 14-01-01 10:55 PM, Joshua Banta wrote: Dear Listserve, I have a data-parsing question for you. I recognize this is more in the domain of PERL/Python, but I don't know those languages! On the other hand, I am pretty good overall with R, so I'd rather get the job done within the R "ecosphere.