powered by
Test whether Result Enum is Ok or an Err.
is.ok(x)
object to be tested
TRUE if x is enumerated type of variant Ok, FALSE otherwise
TRUE
x
Ok
FALSE
# NOT RUN { sqrt_big <- function(x) { if (x > 1000){ return(Ok(sqrt(x))) } Err("Not large enough!") } x <- sqrt_big(250) is.ok(x) # FALSE # }
Run the code above in your browser using DataLab