powered by
try_na wrapper for try function that returns an NA if an error is found.
try_na
try
try_na(expr, silent = TRUE, outFile)
An R expression to try.
Logical to control whether the report of error messages is suppressed. Default is TRUE.
TRUE
A connection, or a character string naming the file to print to (via cat(*, file = outFile)); used only if silent is false, as by default.
Returns an `NA` if any error occurs during the evaluation of a expression. If not, it will return the result of the evaluation.
This is a wrapper on that returns an `NA` if any error occurs during the evaluation of a expression. See try for details.
# NOT RUN { { # try a function that does not exists to produce an error try_na(crazy78(12)) # try a real function (no error) try_na(mean(1:5)) } # }
Run the code above in your browser using DataLab