Re: [R] Testing for existence inside a function [Broadcast]

2007-05-15 Thread Talbot Katz
ting to do is unavailable because it's a bad programming paradigm. But even an explanation if that's the case would be appreciated. -- TMK -- 212-460-5430home 917-656-5351cell >From: "Liaw, Andy" <[EMAIL PROTECTED]> >To: "Talbot Katz" <[EMAI

Re: [R] Testing for existence inside a function [Broadcast]

2007-05-15 Thread Liaw, Andy
Not sure which one you want, but the following should cover it: R> f <- function(x) c(x=missing(x), y=exists("y")) R> f(1) x y FALSE FALSE R> f() x y TRUE FALSE R> y <- 1 R> f() xy TRUE TRUE R> f(1) x y FALSE TRUE Andy From: Talbot Katz > > Hi. > > I'm