grab_args: Arg helper

Description Usage Details Value Author(s) Examples

View source: R/grab_args.R

Description

grab_args

Usage

1

Details

This function is intended as a helper to be used within functions. It creates an object which stores all the arguments passed into the function/parent environment. Useful for when a function has many arguments or ... parameter in which named referencing can be too much work.

Value

The args passed into a function

Author(s)

Carl Boneri, carl.boneri@whyles.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
.examp <- function(arg = NULL, a = 3, is_fun = TRUE, ...){
  fargs <- grab_args()
  return(fargs)
}

> .examp(test_arg = 123)
$arg
NULL
$a
[1] 3
$is_fun
[1] TRUE
$test_arg
[1] 123

CarlBoneri/grabargs documentation built on Oct. 30, 2019, 5:35 a.m.