onarg: change first argument of a function

View source: R/onarg.R

onargR Documentation

change first argument of a function

Description

change first argument of a function

Usage

onarg(f, arg)

Arguments

f

the function

arg

the argument to be called as the first argument

Value

a function that calls f with arg as the first argument.

See Also

wargs, dostats, and apply

Examples

formals(runif)
onarg(runif, 'max')(1:10, 1)
onarg(runif, 'max')(1:10, 10)
#another version of contains
onarg(`%in%`, 'table')(letters, 'y')

dostats documentation built on May 11, 2022, 1:08 a.m.