Message-ID: <498B787A.2090401@idi.ntnu.no>
Date: 2009-02-05T23:38:34Z
From: Wacek Kusnierczyk
Subject: how to separate char and num within a variable
In-Reply-To: <801736.58922.qm@web52812.mail.re2.yahoo.com>
Bill Hyman wrote:
> Hi all,
>
> I read in a column which looks like "chr1:000889594-000889638", and need to break them into three columns like "chr1:", "000889594" and "000889638". How shall I do in R. Thanks a lot for your suggestions!
>
>
if strings is your vector of strings, this should do (assuming the
format is stable across all entries):
strsplit(strings, split=':|-')
vQ