From huber at ebi.ac.uk  Wed Aug 30 22:15:44 2006
From: huber at ebi.ac.uk (Wolfgang Huber)
Date: Wed, 30 Aug 2006 13:15:44 -0700
Subject: [Rd] Suggestion for read.table()
In-Reply-To: <6769639.199881156968166072.JavaMail.root@vms070.mailsrvcs.net>
References: <6769639.199881156968166072.JavaMail.root@vms070.mailsrvcs.net>
Message-ID: <44F5F1F0.3000008@ebi.ac.uk>

Hi Giles,

x = "x y z\n1 2 3\n4 5 6"
res = read.table(textConnection(x), header=TRUE)

will do. See also http://cran.r-project.org/doc/manuals/R-data.html

  Best wishes
   Wolfgang Huber
   EMBL-EBI, Cambridge UK

gilescrane at verizon.net wrote:
> First, I compliment you all
> for such a useful project as R.
> 
> Suggestion:  If read.table() could
> take input from a character string,
> then one could write
> 
> raw=
> "  x   y  z
>    1   2  3
>    4   5  6
> "
> df = read.table(raw,head=TRUE)
> 
> Of course, one can
> cat() to write raw into a 
> temporary file,
> and read.table() from that file.
> However, direct reading 
> might be a good option?
> 
> Hope this is useful.
> Cordially
> Giles Crane
> gilescrane at verizon.net




[Rd] Suggestion for read.table()
Wolfgang Huber