
Last chance! 50% off unlimited learning
Sale ends in
## S3 method for class 'function':
FunctionGenerator(object)
FunctionGenerator
which extends the class
function
representing a function generator.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