Re: [Rd] Problem with args

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Sat, 21 Apr 2012 13:45:24 -0400

On Sat, Apr 21, 2012 at 1:38 PM, Simon Urbanek <simon.urbanek_at_r-project.org> wrote:
>
> On Apr 21, 2012, at 1:03 PM, Gabor Grothendieck wrote:
>
>> args ought to check that its argument is a function:
>>
>>> max <- 3
>>> args(max)
>> NULL
>>
>> e.g.
>>
>>> args <- function(name) {
>> +     name <- match.fun(name)
>> +     base::args(name)
>> + }
>>> args(max)
>> function (..., na.rm = FALSE)
>> NULL
>>
>
> You may want to read the docs in the first place:
>
> Value:
> [...]
>
>     'NULL' in case of a non-function.
>

My post wasn't about the return value -- it was about the fact that the function name can be masked. Try the example I posted. I also posted a solution.

-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Sat 21 Apr 2012 - 17:55:32 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 21 Apr 2012 - 18:40:48 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