"pkg::fun" cannot be a name because it is a function call already
`::`(pkg, fun).
On Tue, Jun 9, 2020 at 8:10 AM Martin Maechler
wrote:
>
> > Göran Broström
> > on Mon, 8 Jun 2020 23:02:30 +0200 writes:
>
> > Thanks for the responses!
> > I found the suggestion
>
> > Call[
> Göran Broström
> on Mon, 8 Jun 2020 23:02:30 +0200 writes:
> Thanks for the responses!
> I found the suggestion
> Call[[1]] <- quote(survival::coxph)
> easiest to implement. And it works.
and it is what we use in R's own R source code in several
places (and that's
Use
Call[[1]] <- quote(survival::coxph)
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Mon, Jun 8, 2020 at 12:12 PM Göran Broström
wrote:
> Hello,
>
> the function 'coxreg' in my package 'eha' is often just a wrapper for
> 'coxph' in survival, so I have code like
>
> if (cox.ph){
>
Thanks for the responses!
I found the suggestion
Call[[1]] <- quote(survival::coxph)
easiest to implement. And it works.
Best, Göran
On 2020-06-08 21:42, Ben Bolker wrote:
I think quote(survival::coxph) will work in place of as.name() ?
On Mon, Jun 8, 2020 at 3:12 PM Göran Broström wrote
I think quote(survival::coxph) will work in place of as.name() ?
On Mon, Jun 8, 2020 at 3:12 PM Göran Broström wrote:
>
> Hello,
>
> the function 'coxreg' in my package 'eha' is often just a wrapper for
> 'coxph' in survival, so I have code like
>
> if (cox.ph){
> Call <- match.cal
You will first need to convert the function call to an expression, then you
can modify the expression as appropriate.
Here's a somewhat contrived minimal example:
> f <- function(z, ...) match.call()
> aaa = f(a=1,2,3)
> str(aaa)
language f(z = 2, a = 1, 3)
> aaa <- as.expression(aaa)
> str(aaa)