[Rd] as.data.frame() : needs "..." ?!

From: Martin Maechler <maechler_at_stat.math.ethz.ch>
Date: Mon 28 Nov 2005 - 10:49:40 GMT

       [diverted from R-help to R-devel]

>>>>> "Gabor" == Gabor Grothendieck <ggrothendieck@gmail.com> >>>>> on Sun, 27 Nov 2005 14:16:34 -0500 writes:

	  <................>

    Gabor> making use of as.data.frame.table we can shorten that     Gabor> slightly to just:

    Gabor> as.data.frame.table(table(Species = iris$Species),

    Gabor>                     responseName = "Count")

    Gabor> Incidently, I just noticed that there is an
    Gabor> inconsistency between as.data.frame and
    Gabor> as.data.frame.table making it impossible to shorten
    Gabor> as.data.frame.table to as.data.frame in the above due
    Gabor> to the responseName= argument which is not referenced     Gabor> in the generic.

>> args(as.data.frame)

    Gabor> function (x, row.names = NULL, optional = FALSE)     Gabor> NULL
>> args(as.data.frame.table)

    Gabor> function (x, row.names = NULL, optional = FALSE, Gabor> responseName = "Freq")     Gabor> NULL

  {If you used str() instead of args() , you wouldn't get the    superfluous extra 'NULL' line }

I think this is an example where we (R-core) haven't followed our own recommendations, namely, that generic functions (and methods) need to have a (trailing) "..." argument just so that new methods can have further arguments.

I'm wondering a bit...
or could there be a good reason in the present case, why this hasn't been done?

Martin



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Mon Nov 28 22:12:26 2005

This archive was generated by hypermail 2.1.8 : Mon 28 Nov 2005 - 14:21:40 GMT