From: Thomas Lumley
>
> On Wed, 25 Jan 2006, Ray Brownrigg wrote:
>
> > There's an even faster one, which nobody seems to have
> mentioned yet:
> >
> > rep(l <- rle(ids)$lengths, l)
>
> I considered this but it wasn't clear to me from the initial
> post that
> each ID occupied a contiguous se
No, not lazy evaluation. The explanation has to do with environments
and how callGeneric works.
It's an interesting (if obscure) example.
Here's the essence of it, embedded in some comments on debugging and on
style. (This will be a fairly long discussion, I'm afraid.)
A useful starting point
Hello,
I've stumbled upon following problem, when trying to overload the methods
for group Math for an S4-class which contains functions as slots.
setClass("NumFunction", representation = list(fun = "function"))
NumFunction <- function(f) new("NumFunction", fun = f)
square <- function(x)