Yes, that is one scenario and for that we need a better class
(possibly a better data.frame class).

But there are other scenarios for which a special class for the
column is better.  Which is why I asked.

> 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])


-- 
Brian D. Ripley,                  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

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

Reply via email to