Re: [Rd] as.data.frame.character lacks nm= argument

From: peter dalgaard <pdalgd_at_gmail.com>
Date: Fri, 14 Sep 2012 17:10:48 +0200

On Sep 14, 2012, at 15:25 , Prof Brian Ripley wrote:

> On 13/09/2012 21:48, Bert Gunter wrote:
>> Bill:
>> 
>> as.data.frame.character() has no nm, argument, so providing one causes
>> the error as you can see from the code. Presumably, this is what you
>> meant by bug/inconsistency, right?
> 
> This is using an undocumented argument, 'nm'.  I don't believe anything is said about what might happen if you do that except that it will be passed to methods -- they are not obliged to accept it.
> 
> If it were intended for this to be a feature, I think the author might have chosen a less opaque name than 'nm'.

It wasn't, but the author (me) might have chosen a _more_ opaque name if he had thought it necessary to keep people from using undocumented arguments. As it happened, I think I just promoted a variable name inside as.data.frame.vector to become an argument.

But it was a long time ago, in a different job, and besides....

> 
> Where we go from here is under discussion in R-core.
> 
>> 
>> -- Bert
>> 
>> On Thu, Sep 13, 2012 at 1:32 PM, William Dunlap <wdunlap_at_tibco.com> wrote:

>>> Is the following behavior with as.data.frame(nm=...) a bug? It is an inconsistency:
>>>
>>>> as.data.frame(LETTERS[1:10], nm="FirstTenLetters")

>>> Error in as.data.frame.vector(x, ..., nm = nm) :
>>> formal argument "nm" matched by multiple actual arguments
>>>
>>> nm= works for integer arguments:
>>>
>>>> as.data.frame(1:10, nm="OneToTen")

>>> OneToTen
>>> 1 1
>>> 2 2
>>> 3 3
>>> 4 4
>>> 5 5
>>> 6 6
>>> 7 7
>>> 8 8
>>> 9 9
>>> 10 10
>>>
>>> Bill Dunlap
>>> Spotfire, TIBCO Software
>>> wdunlap tibco.com
>>>
>>> ______________________________________________
>>> R-devel_at_r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>> 
>> 
>> 
> 
> 
> -- 
> Brian D. Ripley,                  ripley_at_stats.ox.ac.uk
> 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
> 
> ______________________________________________
> R-devel_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
Peter Dalgaard, Professor
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes_at_cbs.dk  Priv: PDalgd_at_gmail.com

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Fri 14 Sep 2012 - 15:16:18 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 15 Sep 2012 - 12:50:42 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive