[R] coercing factors to matrix() --> num/char ? --

Z. Todd Taylor Todd.Taylor at pnl.gov
Wed Jun 23 17:04:32 CEST 1999

Peter Dalgaard BSA <p.dalgaard at biostat.ku.dk> wrote:

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

[ snip... ]

> > >From this logic, coercing to a matrix should coerce to character rather
> > than integer/numeric codes.
> Hm. I'm not sure there really is much logic in this... Factors are
> sometimes character-like, sometimes integer-like.

I'd be interested to hear a discussion of when they need to
behave like integers.  In my work I can't ever remember needing
anything other than the character representation in my "user
level" coding.  I can see the need to access the integers for
"lower level" programming, for example, but when else?

(My thought has always been that factors should *always* coerce
to character unless the user explicitly requests otherwise.)

[ snip... ]

> Not really sure whether the problem is that R is consistent with
> itself or inconsistent with S. If we change as you suggest, we'll
> have two incompatibilities instead of one...

Factors are one area where I deem inconsistency with S a distinct
advantage.  :-)

Z. Todd Taylor
Pacific Northwest National Laboratory
Todd.Taylor at pnl.gov
Why do you say there's one left, when it didn't leave?
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