Skip to content
Prev 274182 / 398506 Next

Problem executing function

Comments inline below.
On 12/10/2011 7:47 AM, Divyam wrote:
This creates the 6 objects a,b,c,d,e and connection, and stores them in 
the list.  Then R prints the list, but you didn't save it anywhere
You need to study "scoping" in R.  The variable named "b" was local to 
your function call.  You copied it's value into X, and returned that, 
but the variable b does not live beyond the function call.

If you had done

value <- fun()

then you could retrieve the copy as

value$b

Duncan Murdoch