From maechler at stat.math.ethz.ch  Thu Aug 26 09:22:50 2004
From: maechler at stat.math.ethz.ch (Martin Maechler)
Date: Thu Aug 26 09:22:53 2004
Subject: [Rd] No is.formula()
In-Reply-To: <856576oqcc.fsf@servant.blindglobe.net>
References: <D7A3CFD7825BD6119B880002A58F06C20C521A8C@groexmb02.pfizer.com>
	<856576oqcc.fsf@servant.blindglobe.net>
Message-ID: <16685.36810.724200.155771@gargle.gargle.HOWL>

>>>>> "tony" == A J Rossini <rossini@blindglobe.net>
>>>>>     on Wed, 25 Aug 2004 14:33:23 -0700 writes:

    tony> "Warnes, Gregory R"
    tony> <gregory_r_warnes@groton.pfizer.com> writes:
    >> There appears to be no "is.formula()" function in
    >> R-1.9.1.  May I suggest that
    >> 
    >> is.formula <- function(x) inherits(x, "formula")
    >> 
    >> be added to base, since formula is a fundimental R type?

    tony> why not just

    tony>     is(x,"formula")
    tony> ?

because the latter needs the methods package and base functions
must work independently of "methods".

The question is what  "fundamental R type" would be exactly.
But I tend to agree with Greg, since formulae are constructed
via the .Primitive '~' operator.

Apropos, I believe we should move the  is.primitive function
from "methods" to "base".

Martin


[Rd] No is.formula()
Martin Maechler