Re: [R] Help in splitting the records

2012-11-26 Thread arun
'Sarah Goslee' Cc: 'r-help' Sent: Monday, November 26, 2012 2:33 PM Subject: Re: [R] Help in splitting the records Another approach is to use gsub() followed by read.table(): > x <- c("qwer$$12$$qwre", "ewrtr$7789$ewwe") > x <- gsub("\\$+&

Re: [R] Help in splitting the records

2012-11-26 Thread David L Carlson
.org] On Behalf Of Bert Gunter > Sent: Monday, November 26, 2012 1:00 PM > To: Sarah Goslee > Cc: r-help > Subject: Re: [R] Help in splitting the records > > Sarah: > > You may not agree, but the following avoids the IMHO ugly rbind() and > separate conversion to numeric

Re: [R] Help in splitting the records

2012-11-26 Thread Bert Gunter
Sarah: You may not agree, but the following avoids the IMHO ugly rbind() and separate conversion to numeric by using scan(): ## first, as before.. x <- c("qwer$$12$$qwre", "ewrtr$7789$ewwe") x <- strsplit(x, "\\$+") ## Then, instead ... x.convert <- data.frame(scan(textConnection(unlist(x)),wh

Re: [R] Help in splitting the records

2012-11-26 Thread Mark Lamias
it appears that two separators are to be treated as one?  From: arunkumar To: r-help@r-project.org Sent: Monday, November 26, 2012 5:51 AM Subject: [R] Help in splitting the records Hi I have set of records seperated by a separator say "$$$" i want to

Re: [R] Help in splitting the records

2012-11-26 Thread arun
- Original Message - From: arunkumar To: r-help@r-project.org Cc: Sent: Monday, November 26, 2012 5:51 AM Subject: [R] Help in splitting the records Hi I have set of records seperated by a separator say "$$$" i want to get the values in a dataframe. eq qwer$$12$$q

Re: [R] Help in splitting the records

2012-11-26 Thread Sarah Goslee
You state that you want "$$$" as the separator, but your example has "$$" and "$" so I'm assuming an indeterminate number of consecutive $. x <- c("qwer$$12$$qwre", "ewrtr$7789$ewwe") x <- strsplit(x, "\\$+") x <- do.call(rbind, x) x <- data.frame(x, stringsAsFactors = FALSE) x$X2 <- as.numeric(x

[R] Help in splitting the records

2012-11-26 Thread arunkumar1111
Hi I have set of records seperated by a separator say "$$$" i want to get the values in a dataframe. eq qwer$$12$$qwre ewrtr$7789$ewwe I want the output as\ V1 V2V3 qwer 12 qwre ewrtr 7789 ewwwe Please help me - Thanks in Advance Arun -- View this message in con