Re: [R] String Handling() for Split a word by a letter

2012-08-28 Thread Rantony
Here I have a variable called "Variable_1". Variable_1 <- "MyDataFrame" Here I want to create another variable, by assigning the value of "Variable_1" . So, it will come like, Assign(Variable_1,data.frame(read.csv("c:\\Mydata.csv"))) --->[this was the 1st requirement, now I got the s

Re: [R] String Handling() for Split a word by a letter

2012-08-28 Thread Jim Lemon
On 08/27/2012 07:29 PM, Rantony wrote: Hi, here im unable to run a string handle function called unpaste(). for eg:- a<- "12345_mydata" Actually my requirement what is i need to get , only 12345. Means that , i need the all letter as a word which is before of first " _ " - symbol of "a". i t

Re: [R] String Handling() for Split a word by a letter

2012-08-27 Thread Rui Barradas
Hello, If the op says he has tried strsplit, maybe a simple subsetting afterwards would solve it. a <- "12345_mydata" strsplit(a, "_")[[1]][1] Hope this helps, Rui Barradas Em 27-08-2012 15:22, jim holtman escreveu: Is this what you want: a<- "12345_mydata" sub("_.*", "", a) [1] "12345

Re: [R] String Handling() for Split a word by a letter

2012-08-27 Thread jim holtman
Is this what you want: > a<- "12345_mydata" > sub("_.*", "", a) [1] "12345" On Mon, Aug 27, 2012 at 5:29 AM, Rantony wrote: > Hi, > > here im unable to run a string handle function called unpaste(). > > for eg:- a<- "12345_mydata" > Actually my requirement what is i need to get , only 12345.

[R] String Handling() for Split a word by a letter

2012-08-27 Thread Rantony
Hi, here im unable to run a string handle function called unpaste(). for eg:- a<- "12345_mydata" Actually my requirement what is i need to get , only 12345. Means that , i need the all letter as a word which is before of first " _ " - symbol of "a". i tried to do with unpaste, it says functio