Is there a no-op function in R so that, even if the parameters would be expensive to evaluate, it returns immediately? I’m looking for a conditional replacement of the stopifnot function.
> noop(runif(1e20))
# returns immediately and uses no memory
I think this would do:
as lazy evaluation comes to the rescue here:
so even when we increase N no runtime increase can be seen.