From p.dalgaard at biostat.ku.dk  Tue Nov 14 18:32:24 2006
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: 14 Nov 2006 18:32:24 +0100
Subject: [Rd] String to list and visa versa
In-Reply-To: <op.ti0mvjx2ffxks9@norisk>
References: <op.ti0mvjx2ffxks9@norisk>
Message-ID: <x2irhihr2v.fsf@turmalin.kubism.ku.dk>

"Tom McCallum" <tom.mccallum at levelelimited.com> writes:

> Hi,
> 
> I need to collapse a list into a string and then reparse it back into the  
> list.  Normally when I need to do this I simply use write.csv and  
> read.csv, but I need to do this in memory within R rather than writing out  
> to file.  

> Are there any bespoke commands that any knows of that does  
> something like this or any tips for doing this that anyone can
> suggest?

Er, perhaps you should send that sentence off to Iain McC.[*], so that
we can find out what killed it. ;-)

>  I  
> basically don't care upon the string representation, only that I can  
> manipulate the list as a string and then reparse it back to a valid list  
> object.

You might want to investigate deparse() and parse().

[*] http://www.johnhannah.net/mccallum.html

-- 
   O__  ---- Peter Dalgaard             ?ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907



[Rd] String to list and visa versa
Peter Dalgaard