Learn R Programming

optional (version 2.0.1)

opt_unwrap: Option Unwrap

Description

Cast an optional object to its base type.

Usage

opt_unwrap(opt)

Arguments

opt

The optional variable to cast back

Value

The object wrapped in opt. NULL if opt is none.

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.

See Also

make_opt(), match_with()

Examples

Run this code
# NOT RUN {
a <- option(5)
class(a)
## [1] "optional"
a <- opt_unwrap(a)

class(a)
## [1] "numeric"
# }

Run the code above in your browser using DataLab