[R] substr not by position but by symbol

2012-05-07 Thread YN Kim
Hi all, One of my variables looks like this: .7_-.3_-.2_.9 And this is a character variable. I made this by combining four different number like .7, -.3, -.2, and .9 using paste function. Now, I want to go back to original format from this one combined character variable. For instance, I want

Re: [R] substr not by position but by symbol

2012-05-07 Thread Ista Zahn
Hi YN, I use strsplit for this: x - .7_-.3_-.2_.9 strsplit(x, split = _) [[1]] [1] .7 -.3 -.2 .9 strsplit(x, split = _)[[1]][3] [1] -.2 Best, Ista On Mon, May 7, 2012 at 9:54 AM, YN Kim y2sile...@gmail.com wrote: Hi all, One of my variables looks like this: .7_-.3_-.2_.9 And this

Re: [R] substr not by position but by symbol

2012-05-07 Thread Rui Barradas
Hello, YN wrote Hi all, One of my variables looks like this: .7_-.3_-.2_.9 And this is a character variable. I made this by combining four different number like .7, -.3, -.2, and .9 using paste function. Now, I want to go back to original format from this one combined character