Re: [Rd] No is.formula()

From: Martin Maechler <maechler_at_stat.math.ethz.ch>
Date: Thu 26 Aug 2004 - 17:22:50 EST

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



R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu Aug 26 17:28:15 2004

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 08:59:23 EST