Skip to content
Prev 279468 / 398506 Next

Argument validation within functions

The quick and dirty way to do so is to use: stopifnot() in conjunction
(if necessary with all() and any()). You can replace that first
condition with a simple is.numeric() as well. A more helpful way (if
this is production code) is to use if statement with the stop()
function directly which lets you provide specific error messages.

Michael
On Tue, Dec 6, 2011 at 6:41 AM, Johannes Radinger <JRadinger at gmx.at> wrote: