Skip to content
Prev 305027 / 398506 Next

Trying to learn how to write a function... can't define a variable??

On Fri, Sep 7, 2012 at 3:16 PM, Rui Barradas <ruipbarradas at sapo.pt> wrote:
Sure it does. help("function") says "If the end of a function is
reached without calling 'return', the
     value of the last evaluated expression is returned." This is why

(z <- ADD(z))
[1] 2

works.

Best,
Ista

 (See the example in R-intro,