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]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.