Re: [R] Existence of formal arguments.

2008-06-05 Thread Bert Gunter
Thursday, June 05, 2008 9:02 PM To: Duncan Murdoch Cc: R-help 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 &

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() fu

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

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

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

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

[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 g