Re: [R] transforming one column into 2 columns

From: Benilton Carvalho <bcarvalh_at_jhsph.edu>
Date: Sat, 2 Feb 2008 12:47:05 -0500

help("strsplit")
b

On Feb 2, 2008, at 12:43 PM, joseph wrote:

>
>
> Hello
>
> I have a data frame and one of its columns is as follows:
>
>
>
>
> Col
>
>
> chr1:71310034
>
>
> chr14:23354088
>
>
> chr15:37759058
>
>
> chr22:18262638
>
>
> chrUn:31337214
>
>
> chr10_random:4369261
>
>
> chrUn:3545097
>
>
>
>
>
> I would like to get rid of colon (:) and replace this column
> with two new columns containing the terms on each side of the colon.
> The new columns
> should look as follows:
>
>
>
>
> Col_a Col_b
>
>
> chr1 71310034
>
>
> chr14 23354088
>
>
> chr15 37759058
>
>
> chr22 18262638
>
>
> chrUn 31337214
>
>
> chr10_random 4369261
>
>
> chrUn 3545097
>
>
>
>
>
> Any help will be much appreciated
>
>
> Joseph
>
>
>
>
>
>
>
> ____________________________________________________________________________________
> Looking for last minute shopping deals?
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat 02 Feb 2008 - 17:56:03 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 02 Feb 2008 - 19:30:25 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive