Learn R Programming

dostats (version 1.3.3)

onarg: 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

Run this code
# NOT RUN {
formals(runif)
onarg(runif, 'max')(1:10, 1)
onarg(runif, 'max')(1:10, 10)
#another version of contains
onarg(`%in%`, 'table')(letters, 'y')
# }

Run the code above in your browser using DataLab