Is there a recommended or "good" way to check if the evaluation of an expression returns an error? e.g. var(NA) I wish var(NA) to return NA or "err", or some other value, even a text-string, but not an error message. I am using a loop to load many samples of data and to perform analysis on each sample. On occasion, the function I execute returns an error message. (e.g. when all data is NA, etc). I wish for the loop to continue to execute, and to have the function return an NA or NULL rather then an error message.
--------------------------------- [[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.