drop_fn_params: Drop parameters from a function and replace them with...

View source: R/utils-optimization.R

drop_fn_paramsR Documentation

Drop parameters from a function and replace them with constants inside the function body.

Description

Drop parameters from a function and replace them with constants inside the function body.

Usage

drop_fn_params(fn, args)

Arguments

fn

function A non-primitive function to remove parameters from (via base::formals(fn)).

args

list A list where names are the function arguments (parameters) to remove and the values are the appopriate value to replace the parameter with in the function body.

Value

function A new non-primitize function with the parameters named in args deleted and their values fixed with the values from args in the function body.


bhklab/CoreGx documentation built on March 14, 2024, 3:04 a.m.