Skip to content

No is.formula()

4 messages · Warnes, Gregory R, A.J. Rossini, Martin Maechler +1 more

#
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?

Gregory R. Warnes
Manager, Non-Clinical Statistics
Pfizer Global Research and Development



LEGAL NOTICE\ Unless expressly stated otherwise, this messag...{{dropped}}
#
"Warnes, Gregory R" <gregory_r_warnes@groton.pfizer.com> writes:
why not just 

    is(x,"formula") 

?

best,
-tony
#
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
#
On Thu, 26 Aug 2004, Martin Maechler wrote:

            
(It would be a `stats' function, I believe, but equally true.)
Given how long we have lived without either (methods needs is.primitive 
for its internal workings, only) I believe we should continue to do so.

May I remind people that our aim is for base to be as lean as possible, 
since we now use R *a lot* for computations during installation, checking 
etc.  This discourages adding trivial wrappers like these, especially to 
base.