onarg {dostats} | R Documentation |
change first argument of a function
onarg(f, arg)
f |
the function |
arg |
the argument to be called as the first argument |
a function that calls f
with arg
as the first argument.
formals(runif)
onarg(runif, 'max')(1:10, 1)
onarg(runif, 'max')(1:10, 10)
#another version of contains
onarg(`%in%`, 'table')(letters, 'y')