[R] lda in R vs S

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Fri May 7 01:45:45 CEST 1999


"Marc R. Feldesman" <feldesmanm at pdx.edu> writes:

> 
> No actually I *had* a factor.
> 
> is.factor(sarich.na[,3])
> [1] TRUE
> > 
> 
> This is why I was perplexed by the behavior after Brian suggested the
> various alternatives.

Strange things may happen if the "factor" class gets set by unorthodox
means. E.g.:

> d<-letters[1:3]
> class(d)<-"factor"
> d
NULL
Levels:   
> unclass(d)
[1] "a" "b" "c"
> is.factor(d)   
[1] TRUE
> factor(d)
Error: invalid labels argument in "factor"

Another possibility is that it is the indexing in itself that is
confusing the model formula parsing code. Perhaps it may work to put
in I(sarich.na[,3])?

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list