Skip to content
Back to formatted view

Raw Message

Message-ID: <941871A13165C2418EC144ACB212BDB0BEB2D1@dshsmxoly1504g.dshs.wa.lcl>
Date: 2009-02-10T19:28:24Z
From: Nordlund, Dan (DSHS/RDA)
Subject: How to split a character vector into 3 vectors
In-Reply-To: <21939492.post@talk.nabble.com>

See ?strsplit

Hope this is helpful,

Dan

Daniel J. Nordlund
Washington State Department of Social and Health Services
Planning, Performance, and Accountability
Research and Data Analysis Division
Olympia, WA  98504-5204
 
 

> -----Original Message-----
> From: r-help-bounces at r-project.org 
> [mailto:r-help-bounces at r-project.org] On Behalf Of kayj
> Sent: Tuesday, February 10, 2009 10:50 AM
> To: r-help at r-project.org
> Subject: [R] How to split a character vector into 3 vectors
> 
> 
> Hi ,
> 
> 
> Does any one know how to split a character vector , I have a 
> vector X that
> looks like this and each row has 3 characters
> 
>   X
> ASK
> DGH
> ASG
> AUJ
> FRT
> 
> I would like to split the vector into 3 vectors that look like this
> 
> X1	X2	X3
> A  	S	K
> D	G	H
> A	S	G
> A	U	J
> U	R	T
> 
> thanks
> 
> -- 
> View this message in context: 
> http://www.nabble.com/How-to-split-a-character-vector-into-3-v
> ectors-tp21939492p21939492.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> 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.
> 
>