Re: [R] Convert numerical value into function which returns numerical value

2015-04-09 Thread William Dunlap
You can make such functions by using the fact that a function (really, a 'closure') always has access to the environment in which the function was created. E.g. makeConstantFunction <- function(constant) { force(constant) # evaluate the argument now function(PAI) { constant

[R] Convert numerical value into function which returns numerical value

2015-04-09 Thread Rainer M Krug
Hi I want convert, in a function, an argument from a numerical value to a function which returns this value.: My Code: --8<---cut here---start->8--- dep <- 13 dep <- function() {dep} dep --8<---cut here---end--->8--- This