Skip to content
Prev 351340 / 398502 Next

Using names in function with ellipsis (non standard evaluation?)

On 28/05/2015 1:40 PM, Luca Cerone wrote:
Sorry, I misunderstood your question.  I didn't notice that g calls f.
You should write g to call f with names on the parameters, i.e.

g <- function(x,y) f(x=x, y=y)

then f will receive the parameters with names on them.  I'd still advise
against using c(...), but it will give you the output you want with that
input; the problem is if your users do something like
g(1:2, 3:4) (which would give c(x1=1, x2=2, y1=3, y2=4)).

Duncan Murdoch