Inconsistencies with is.function

Kjetil Halvorsen
Mon, 01 Mar 1999 14:53:31 +0100

> debug(sin)
Error in debug(sin) : argument must be a function
> is.function(sin)
[1] TRUE
> debug("[<-")
Error in debug("[<-") : argument must be a function
> is.function(get("[<-"))
[1] TRUE

The problem having to do with .Primitive functions. R should agree
with itself on what is a function! to work around, I used

is.Primfun <- function(fun) is.function(fun) && is.null(body(fun))

but I'm not sure if that is failsafe.

Kjetil Halvorsen
r-devel mailing list -- Read
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: