[Rd] factors in data.frames (PR#835)
james.lindsey@luc.ac.be
james.lindsey@luc.ac.be
Thu, 1 Feb 2001 10:56:07 +0100 (MET)
The following seems to be a contradiction:
> df <- data.frame(x=gl(2,1,10))
> df[,1]
[1] 1 2 1 2 1 2 1 2 1 2
Levels: 1 2
> df[,1,drop=F]
x
1 1
2 2
3 1
4 2
5 1
6 2
7 1
8 2
9 1
10 2
> is.factor(df[,1,drop=F])
[1] FALSE
> is.factor(df[,1])
[1] TRUE
with R1.2.1 both MS Windows and Intel RH5.2 versions.
Jim
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._