Adding on Michael comment:

If your trap all conditions that render your main code invalid at the
beginning of your code, the main code does not have to be within the "else"
part of a if else statement.

For instance:

myf <- function(a,b,c){

if ( ! (is.numeric(a) && (a>=0 & a<=1) ) ){
  stop('a is invalid')
}

if (<all bad conditions for b>){
  stop('b is invalid')
}

if (<all bad conditions for c>){
  stop('c is invalid')
}

  return(a+b+c)

}

Sebastien

	[[alternative HTML version deleted]]

