Hi All,

I have a data with a variable like this:

Column 1

"123abc"
"12cd34"
"1e23"
...

Now I want to do an operation that can split it into two variables:

Column 1        Column 2         Column 3

"123abc"         123                  "abc"
"12cd34"         12                    "cd34"
"1e23"             1                      "e23"
...

So basically, I want to split the original variabe into a numeric one and a
character one, while the splitting element is the first character in Column
1.

I searched the forum with key words "strsplit"and "substr", but still can't
solve this problem. Can anyone give me some hints?

Thanks in advance,

FD

        [[alternative HTML version deleted]]

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to