From ucfagls at gmail.com  Sat Aug 24 05:49:49 2013
From: ucfagls at gmail.com (Gavin Simpson)
Date: Fri, 23 Aug 2013 21:49:49 -0600
Subject: [Rd] Accessing the formals() of a non-exported method without
	:::?
In-Reply-To: <CE3B5F3F-0589-4A35-A9D3-6F424695661E@gmail.com>
References: <CAAHES9yLLQ3F_K5ws4x3d-gq-eSWL=mQfcbOqgQKkqTpH_vNgw@mail.gmail.com>
	<CE3B5F3F-0589-4A35-A9D3-6F424695661E@gmail.com>
Message-ID: <CAAHES9xZCRozYV-n0Fg8n2wbE4QfWUzGkLycsbBnyAGARZC2Gw@mail.gmail.com>

Thanks Michael, somewhat embarrassingly, I had forgotten that a
package can refer to any of *its own packages*. So I don't need
analogue:::foo.bar as that is being called from a function in the
analogue namespace.

Cheers,

G

On 23 August 2013 09:27, R. Michael Weylandt
<michael.weylandt at gmail.com> <michael.weylandt at gmail.com> wrote:
>
>
> On Aug 23, 2013, at 11:15, Gavin Simpson <ucfagls at gmail.com> wrote:
>
>> Dear List,
>>
>> I'm in the process of making tweaks to my various R packages following
>> changes in r-devel for package checks. I'm wondering about the one use
>> of ::: in one of my packages. I am arranging for a call to a
>> non-exported S3 method via do.call. For this I need the arguments of
>> the function and hence I was doing
>>
>>    Args <- head(formals(analogue:::wa.default), -1)
>>
>> Following the recent thread on legitimate uses of ::: I think the
>> above is both acceptable and won't generate a Note now with R CMD
>> check following a recent change to that code. But is there a better
>> way to get the formal arguments of a non-exported S3 method?
>>
>
> Something like (untested)
>
> formalsS3 <- function(...) formals(getS3method(...))
>
> might work. I haven't checked to see how R CMD check feels about getS3method() though.
>
> Michael
>
>
>> Thanks.
>>
>> G
>>
>> --
>> Gavin Simpson
>>
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel



-- 
Gavin Simpson, PhD



[Rd] Accessing the formals() of a non-exported method without :::?
Gavin Simpson