[R] What is a 'closure'?

Ben Bolker bbolker at gmail.com
Thu Jan 19 21:39:41 CET 2012


Ajay Askoolum <aa2e72e <at> yahoo.co.uk> writes:

> 
> Michael, thank you, especially for the link. I think I understand.
> 
> The vocabulary is so different! I know 'closure' as 'user-defined function'.
> 

  Not quite.  All (??) user-defined functions are closures, but lots
of non-user-defined functions are closures too ...

> typeof(mean)
[1] "closure"
> typeof(sum)
[1] "builtin"
> typeof(apply)
[1] "closure"



More information about the R-help mailing list