What I want to do is the following: I want to write a function, let's call it 'function_creator' with one argument: name, and some additional arguments, such that its output is a function for which the name of the argument is the argument I passed to 'function_creator'.
The following code-snippet illustrates how I would like function_creator to behave:
f <- function_creater(name = "y", y_min = 2, y_max = 3)
f
function(y) {
y >= 2 && y <= 3
}
How do I do this in R?? I guess that something like sys.call() might be helpful but I don't really know how to proceed from there.