Inconsistencies with is.function

Kjetil Halvorsen khal@alumni.uv.es
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 http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._