I am trying to call the function `function`
to define a function in R code.
As we all know™️, `function`
is a .Primitive
that’s
For completeness’ sake, lionel’s answer hints at a way of calling `function`
after all. Unfortunately it’s rather restricted, since we cannot pass any argument definition except for NULL
:
mean5 = `function`(NULL, mean(x, ...))
formals(mean5) = formals(mean)
(Note the lack of quoting around the body!)
This is of course utterly unpractical (and formals<-
internally calls as.function
anyway.)