bind_to_function: Encloses argument in a function's environment

View source: R/bind_to_function.R

bind_to_functionR Documentation

Encloses argument in a function's environment


This function takes a function f and a series of named arguments, and returns a closure of f which will only rely on one single argument 'param'. This is used to reduce the number of arguments passed around to likelihood or movement functions. This functionality is used internally when creating closures of custom moves in bind_moves.


bind_to_function(f, ...)



The function to which arguments are bound.


Named arguments to bind to the function's environment.


Initial code by Rich FitzJohn (see 'references') with some adaptations by Thibaut Jombart


Initial code comes from the partially_apply function in the 'rodeint' package richfitz/rodeint.

outbreaker2 documentation built on May 23, 2022, 5:06 p.m.