[Rd] No is.formula()

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Aug 26 09:42:22 CEST 2004


On Thu, 26 Aug 2004, Martin Maechler wrote:

> >>>>> "tony" == A J Rossini <rossini at blindglobe.net>
> >>>>>     on Wed, 25 Aug 2004 14:33:23 -0700 writes:
> 
>     tony> "Warnes, Gregory R"
>     tony> <gregory_r_warnes at 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".

(It would be a `stats' function, I believe, but equally true.)

> 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".

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.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-devel mailing list