Message-ID: <x2zml5apv0.fsf_-_@turmalin.kubism.ku.dk>
Date: 2006-02-06T07:49:39Z
From: Peter Dalgaard
Subject: Embedding datasets, was Re: srt --- slope text with function?
In-Reply-To: <43E6A4CD.8080800@stats.uwo.ca>
Duncan Murdoch <murdoch at 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 at biostat.ku.dk) FAX: (+45) 35327907