onarg: change first argument of a function

Description Usage Arguments Value See Also Examples

View source: R/onarg.R

Description

change first argument of a function

Usage

1
onarg(f, arg)

Arguments

f

the function

arg

the arg 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

1
2
3
4
5
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 29, 2017, 6:07 p.m.

Search within the dostats package
Search all R packages, documentation and source code