From maechler at stat.math.ethz.ch  Mon Nov 28 11:49:40 2005
From: maechler at stat.math.ethz.ch (Martin Maechler)
Date: Mon, 28 Nov 2005 11:49:40 +0100
Subject: [Rd] as.data.frame() : needs "..." ?!
In-Reply-To: <971536df0511271116g29b2b469i2d87abc53addc173@mail.gmail.com>
References: <20051127174920.48183.qmail@web51914.mail.yahoo.com>
	<XFMail.051127182712.Ted.Harding@nessie.mcc.ac.uk>
	<971536df0511271116g29b2b469i2d87abc53addc173@mail.gmail.com>
Message-ID: <17290.57540.60564.949167@stat.math.ethz.ch>

       [diverted from R-help to R-devel]

>>>>> "Gabor" == Gabor Grothendieck <ggrothendieck at 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



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