Steve Dutky <[EMAIL PROTECTED]> wrote:
> I have a function that manipulates a list of numeric and character
> components of equal length and wants to return a data.frame.
> ...
> How can I get the columns Char1, Char2, (...CharN) returned coerced to
> character and not factor?

Prof Brian Ripley <[EMAIL PROTECTED]> wrote:
> ... We should ask why you want character columns in a data frame?...

I think Steve's situation is very common.  It points up a long-standing gap in
the S language, namely a class of objects for tabular data that is less
restrictive than data.frame or matrix.  Data frames are really designed for
statistics (thus their inclination towards factors and valid column names),
while matrices can only handle a single mode of data (numeric or character).

In my own world, I've "implemented" this "class" as lists of equal-length
vectors, and built many tools for it that mirror read.table, write.table,
merge, cbind, rbind, etc.  Except that I've done it sloppily, without using
real classes or constructors/validators/methods.

It would be nice to have a real class "table" (maybe data.frame would extend
it?).  But no, I'm not volunteering to build it. :-/
-- 
                              -- David Brahm ([EMAIL PROTECTED])

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to