Learn R Programming

ParallelLogger (version 3.4.1)

createArgFunction: Create an argument function

Description

Create an argument function

Usage

createArgFunction(
  functionName,
  excludeArgs = c(),
  includeArgs = NULL,
  addArgs = list(),
  rCode = c(),
  newName
)

Value

A character vector with the R code including the new function.

Arguments

functionName

The name of the function for which we want to create an args function.

excludeArgs

Exclude these arguments from appearing in the args function.

includeArgs

Include these arguments in the args function.

addArgs

Add these arguments to the args functions. Defined as a list with format name = default.

rCode

A character vector representing the R code where the new function should be appended to.

newName

The name of the new function. If not specified, the new name will be automatically derived from the old name.

Details

This function can be used to create a function that has (almost) the same interface as the specified function, and the output of this function will be a list of argument values.

Examples

Run this code
createArgFunction("read.csv", addArgs = list(exposureId = "exposureId"))

Run the code above in your browser using DataLab