Re: [Rd] String to list and visa versa

From: Peter Dalgaard <p.dalgaard_at_biostat.ku.dk>
Date: Tue 14 Nov 2006 - 17:32:24 GMT

"Tom McCallum" <tom.mccallum@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@biostat.ku.dk)                  FAX: (+45) 35327907

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Wed Nov 15 04:57:46 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 14 Nov 2006 - 18:30:42 GMT.

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