From thomas@biostat.washington.edu  Wed May 21 16:01:11 1997
From: thomas@biostat.washington.edu (Thomas Lumley)
Date: Wed, 21 May 1997 08:01:11 -0700 (PDT)
Subject: R-alpha: factors ...
In-Reply-To: <199705211031.MAA31074@aragorn.ci.tuwien.ac.at>
Message-ID: <Pine.SUN.3.95.970521075757.7924A-100000@zen>

On Wed, 21 May 1997, Kurt Hornik wrote:

> Perhaps someone can enlighten me here:
> R> x <- factor(LETTERS[1:3])
> [1] "factor"
> 
> S-PLUS has
> > x <- factor(LETTERS[1:3])
> > mode(unclass(x))
> [1] "numeric"

It's a feature. R has a primitive factor type, S-PLUS doesn't and so loses
factorness with unclass(). You can use as.numeric() to coerce to numeric
in either system. 


Thomas Lumley
------------------------------------------------------+------
Biostatistics		: "Never attribute to malice what  :
Uni of Washington	:  can be adequately explained by  :
Box 357232		:  incompetence" - Hanlon's Razor  :
Seattle WA 98195-7232	:				   :
------------------------------------------------------------

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
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: factors ...
Thomas Lumley