Skip to content
Prev 309172 / 398506 Next

summation sign

On Oct 27, 2012, at 01:34 , sffarooqi wrote:

            
You pretty much did it already:
[1] 2.603318

I.e., just have x as a vector of length 5 and the rest is done automagically.

(And, BTW, you don't need return() in a function like that in R, the return value is the value of the last expression.)