powered by
## S3 method for class 'function': FunctionGenerator(object)
FunctionGenerator
function
readPlain
funGen <- FunctionGenerator(function(y, ...) { if (is(y, "integer")) function(x) x+1 else function(x) x-1 }) funGen funGen(3L) funGen("a")
Run the code above in your browser using DataLab