Re: [R] help splitting a data frame

2010-07-29 Thread Charles C. Berry
On Thu, 29 Jul 2010, kayj wrote: Hi All, I have a dataset that I would like to split based on : or – ( the data file is tab delimited) for example: Ny:23-45AC BA:88-91DB KJ:21-13PA And I would like the data to be splitted and the final results look like NY 23

Re: [R] help splitting a data frame

2010-07-29 Thread stephen sefick
strsplit(s, split=":") anyhoo ?strsplit should get you started On Thu, Jul 29, 2010 at 1:34 PM, kayj wrote: > > Hi All, > > I have a dataset that I would like to split based on : or – ( the data file > is tab delimited) for example: > Ny:23-45        AC > BA:88-91        DB > KJ:21-13        P

Re: [R] help splitting a data frame

2010-07-29 Thread Henrique Dallazuanna
Try this: # Lines <- readLines('your_file') Lines <- "Ny:23-45AC BA:88-91DB KJ:21-13PA" DF <- read.table(textConnection(gsub("[-:]", "\t", Lines))) closeAllConnections() On Thu, Jul 29, 2010 at 2:34 PM, kayj wrote: > > Hi All, > > I have a dataset that I would like to

[R] help splitting a data frame

2010-07-29 Thread kayj
Hi All, I have a dataset that I would like to split based on : or – ( the data file is tab delimited) for example: Ny:23-45AC BA:88-91DB KJ:21-13PA And I would like the data to be splitted and the final results look like NY 23 45 AC BA 88 91