s-news
[Top] [All Lists]

Splitting a string into a vector of strings

To: S-News <s-news@lists.biostat.wustl.edu>
Subject: Splitting a string into a vector of strings
From: Thom Burnett <Thom.Burnett@cognigencorp.com>
Date: Tue, 24 May 2005 11:00:11 -0400
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113
What's the quick and easy way to make
a <- "AB, ABC, FG, HIJKL, M"
into

b <- c("AB", "ABC", "FG", "HIJKL", "M")

I haven't yet seen this at all using match , scan, regexpr, etc.
I know that I can locate the ',' and then loop to call substring but that seems unecessarily complicated.

Thom

<Prev in Thread] Current Thread [Next in Thread>