Re: [R] Converting strings with internal delimiters into lists

From: Thomas Lumley <>
Date: Fri 12 Aug 2005 - 04:26:58 EST

On Thu, 11 Aug 2005, shelby berkowitz wrote:

> Hi UserRs,
> I know that there has to be an easy way to do this in
> R (probably easy enough that once someone clues me in
> I'll smack myself on the forehead for not figuring it
> out myself), but my searches on my own have not
> yielded any hints.

I think you are looking for strsplit()


> I have many fields in my dataset that participants
> entered as "free lists" - i.e., the field constitutes
> a varying number of names each separated by a
> delimiter. The resulting data frame might look
> something like:
> testtable<-
> In actuality the names are typically multi-word
> organization names, but you get the idea...
> What I need to do is to convert these text strings
> into lists comprised of the elements separated by the
> commas so that I can work with these elements across
> the dataset, manipulate them, etc.
> Thanks in advance to any kind soul who can offer me a
> tip to the appropriate functions or a line of code!
> Best,
> Shelby
> ______________________________________________
> mailing list
> PLEASE do read the posting guide!

Thomas Lumley			Assoc. Professor, Biostatistics	University of Washington, Seattle

______________________________________________ mailing list PLEASE do read the posting guide! Received on Fri Aug 12 04:30:48 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:39:47 EST