opt_unwrap {optional} | R Documentation |
Option Unwrap
Description
Cast an optional object to its base type.
Usage
opt_unwrap(opt)
Arguments
opt |
The optional variable to cast back |
Details
Since an optional can be used the same way as its base type, there is no known scenario where this function might be useful.
Value
The object wrapped in opt
.
NULL
if opt
is none
.
See Also
make_opt(), match_with()
Examples
a <- option(5)
class(a)
## [1] "optional"
a <- opt_unwrap(a)
class(a)
## [1] "numeric"
[Package optional version 2.0.1 Index]