HN ) (Avoid deep nesting for better readability.) Shareware Amateurs vs. Shareware Professionals . esoteric R: introducing closures . Does function itself not create a closure ? f <- (function() { x <- 3 return(function(y) x * y) })() > do.call(f, list(y=1:10)) [1] 3 6 9 12 15 18 21 24