Flip: Flip

Description Usage Arguments Value Examples

View source: R/flip.R

Description

Rearranges order of named function arguments (excludes dotted argument list). By default, reverses order of named function arguments . If pos argument is specified, these arguments are arranged to come first. Useful with *apply() functions.

Usage

1
Flip(fn, pos)

Arguments

fn

a function

pos

position number or argument name

Value

A function in which the position of arguments is ordered.

Examples

1
2
3
4
5
6
7
Foo <- function(x,y,z)
  x / y + z

Flip(Foo)
Flip(Foo,"z")
Flip(Foo,2:3)
Flip(Foo,c("y","z"))

stakahama/Rfunctools documentation built on June 8, 2021, 10:25 p.m.