Learn R Programming

linbin (version 0.1.3)

build_function_call: Build Function Call

Description

Helper function for sampling_functions. Builds a function call in a enclosed environment with all fixed arguments and column indices so that the function can later be passed row subsets of an event table for sampling.

Usage

build_function_call(
  fun,
  bin.col,
  data.cols,
  arg.cols = NULL,
  group.cols = NULL,
  arglist = NULL
)

Arguments

fun

Function to use.

bin.col

Column defining the grouping of bins.

data.cols

Columns to each be passed as first argument to the function.

arg.cols

Columns to be passed as the second, third, ... arguments of the function.

group.cols

Columns to be used as factors.

arglist

Additional arguments to pass to function fun.

Value

A function whose parent environment encloses all of its fixed arguments.