View source: R/error_handling.R
fail_if_NA | R Documentation |
Inputs any object, checks if it contains NA. If yes, throws an error. If not, returns the input.
fail_if_NA(x, msg = "Input contained NA.")
x |
(any object) The object to test. |
msg |
(chr) An error message. |
Invisibly returns the input.
fail_if_NA(1:10) #no NAs
fail_if_NA(c(1:3, NA, 1:3)) #NAs
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.