[Rd] Discrepancy between is.list() and is(x, "list")

Abs Spurdle @purd|e@@ @end|ng |rom gm@||@com
Tue Mar 26 04:27:55 CET 2019


> I have noticed a discrepancy between is.list() and is(x, “list”)

There's a similar problem with inherits().

On R 3.5.3:

> f = function () 1
> class (f) = "f"

> is.function (f)
[1] TRUE
> inherits (f, "function")
[1] FALSE

I didn't check what happens with:
> class (f) = c ("f", "function")

However, they should have the same result, regardless.

> Is this discrepancy intentional?

I hope not.

	[[alternative HTML version deleted]]



More information about the R-devel mailing list