[R]: global and local variables

2003-12-09 Thread allan clark
Hi all I have a problem pertaining to local and global variables. Say I have a function defined as follows: a-function(x) {yx^2} i.e a(2) [1] 4 function b is now defined to take the value of y and do some manipulation with it. As it stands I dont know how to

Re: [R]: global and local variables

2003-12-09 Thread Uwe Ligges
allan clark wrote: Hi all I have a problem pertaining to local and global variables. Say I have a function defined as follows: a-function(x) {yx^2} i.e a(2) [1] 4 The function a specified above won't return 4! function b is now defined to take the value of y and

[R]: global and local variables

2003-12-09 Thread allan clark
Hi Thanx for those who responded to my problem. In my previous email I tried to ask a general question and probably never explained myself correctly. I wanted to prevent sending this long email. My apologies. This is my actual problem. I have a regression problem. I am

Re: [R]: global and local variables

2003-12-09 Thread Karl Knoblick
Hi! I'm no guru in R. But I can think of 2 ways (have to be tried): 1) As Uwe Ligges said: just save return the stored variable a-preprocess(xdata) and return it (if you want to return more than 1 item use list) and give this variable to the next function. Example: func1-function(x) { y-x^2 #