Consider the following code: f <- function(x)function(y){x+y} all.equal(f(5), f(0))
This returns TRUE, when it should return FALSE; I think it’s hard to make the case that f(5) and f(0) are “approximately equal” in any meaningful sense. Digging into the code for all.equal(), I see that all.equal(f(5), f(0)) results in a call to all.equal.language(f(5), f(0)), which only compares the function texts for equality. If it is decided to leave this behavior as-is, then at least it should be documented. Currently I cannot find any documentation for all.equal applied to functions. [[alternative HTML version deleted]] ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel