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
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
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
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
4 matches
Mail list logo