From p.dalgaard@biostat.ku.dk  Wed Dec  3 20:58:07 1997
From: p.dalgaard@biostat.ku.dk (Peter Dalgaard BSA)
Date: 03 Dec 1997 21:58:07 +0100
Subject: R-alpha: Re^3: data file names
In-Reply-To: Martin Maechler's message of Wed, 3 Dec 1997 16:56:31 +0100
References: <199712031556.QAA03899@sophie.ethz.ch>
Message-ID: <x2ra7ukuu8.fsf@blueberry.kubism.ku.dk>

Martin Maechler <maechler@stat.math.ethz.ch> writes:

> Factors are somewhat different in R and S
> (internally: clear;  in 'dput(.)' -- maybe not necessary).

Hmm:

R:

> dput(gl(4,1,8))
structure(factor(c(1, 2, 3, 4, 1, 2, 3, 4), levels=1:4), class =
"factor", .Label = c("1", 
"2", "3", "4"))
> ff<-structure(.Data = c(1, 2, 3, 4, 1, 2, 3, 4), .Label = c("1",
"2", "3", "4"), 
+         class = "factor")
> dput(ff)
structure(factor(c(1, 2, 3, 4, 1, 2, 3, 4), levels=1:4), class =
"factor", .Label = c("1", 
"2", "3", "4"))

Splus:

> dput(gl(4,1,8))
structure(.Data = c(1, 2, 3, 4, 1, 2, 3, 4), .Label = c("1", "2", "3", "4"), 
        class = "factor")
> ff<-structure(factor(c(1, 2, 3, 4, 1, 2, 3, 4), levels=1:4),
+ class = "factor", .Label = c("1", 
"2", "3", "4"))
> dput(ff)
structure(.Data = c(1, 2, 3, 4, 1, 2, 3, 4), .Label = c("1", "2", "3", "4"), 
        class = "factor")

I.e. when R creates a structure based on the output of Splus's dput(factor),
you get the same structure as if you had created the factor directly,
and vice versa. 

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


R-alpha: Re^3: data file names
Peter Dalgaard BSA