The main use of this function is in benchmarking
(optimization) algorithms. It ensures that the algorithm does not
perform more than budget function evaluations by tracking
the number of evaluations performed and raising a
condition if the budget is reached. For this to
work, the function must find one and only one soofunction
object in expr which will be replaced by a modified test
function that performs the tracking and signaling.
While elegant from a users perspective, this function is not fool
proof. It is possible to construct situations were it will
fail. For example, if the employed optimization algorithm is
written in C and does not use the memory allocation routines
provided by R, then this will certainly lead to memory leaks. You have been warned.