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
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
2 matches
Mail list logo