[R] Existence of formal arguments.

2008-06-05 Thread Rolf Turner
I just discovered what seems to me to be a slight funny in respect of formal argument names. If I define a function foo - function(a,b){ ... whatever ...} then ``inside'' foo() the exists() function will return TRUE from ``exists(a) whether an object named ``a'' exists or not. But

Re: [R] Existence of formal arguments.

2008-06-05 Thread Duncan Murdoch
On 05/06/2008 8:23 PM, Rolf Turner wrote: I just discovered what seems to me to be a slight funny in respect of formal argument names. If I define a function foo - function(a,b){ ... whatever ...} then ``inside'' foo() the exists() function will return TRUE from ``exists(a) whether an

Re: [R] Existence of formal arguments.

2008-06-05 Thread Erik Iverson
Note the difference between test - function(a) { exists(a, mode = symbol) } test() and test2 - function(a) { exists(a, mode = numeric) #say } test2() and then note that the default mode argument to exists is any. Rolf Turner wrote: I just discovered what seems to me to be a slight

Re: [R] Existence of formal arguments.

2008-06-05 Thread Rolf Turner
On 6/06/2008, at 12:57 PM, Erik Iverson wrote: Note the difference between test - function(a) { exists(a, mode = symbol) } test() and test2 - function(a) { exists(a, mode = numeric) #say } test2() and then note that the default mode argument to exists is any. Basically, I think,

Re: [R] Existence of formal arguments.

2008-06-05 Thread Charilaos Skiadas
On Jun 5, 2008, at 9:13 PM, Duncan Murdoch wrote: On 05/06/2008 8:23 PM, Rolf Turner wrote: I just discovered what seems to me to be a slight funny in respect of formal argument names. If I define a function foo - function(a,b){ ... whatever ...} then ``inside'' foo() the exists()

Re: [R] Existence of formal arguments.

2008-06-05 Thread Bert Gunter
forum Subject: Re: [R] Existence of formal arguments. On Jun 5, 2008, at 9:13 PM, Duncan Murdoch wrote: On 05/06/2008 8:23 PM, Rolf Turner wrote: I just discovered what seems to me to be a slight funny in respect of formal argument names. If I define a function foo - function(a,b