Skip to contents

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.