[R] Embedding datasets, was Re: srt --- slope text with function?

From: Peter Dalgaard <p.dalgaard_at_biostat.ku.dk>
Date: Mon 06 Feb 2006 - 18:49:39 EST

Duncan Murdoch <murdoch@stats.uwo.ca> writes:

> On 2/5/2006 4:28 PM, ivo welch wrote:

> > * has it now become possible to embed sample data sets in R code? (I
> > asked this a while back, but there were nly kludges, no standard
> > "pretty" solutions.)
>
> I don't understand the question. dump() produces R code that can
> reconstruct a dataset; is that what you want?

Or dput(). You can also read from a text connection, using constructions like

data <- read.table(
textConnection(
"a b c d
2 1 3 5
0 2 4 1
1 2 3 4"), header=TRUE)

(The quotes have to placed as shown, or you get extra blank lines).

-- 
   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-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Mon Feb 06 18:58:46 2006

This archive was generated by hypermail 2.1.8 : Tue 07 Feb 2006 - 00:53:21 EST