Skip to contents

Wrapper for possible null objects

Usage

single_value(x)

Arguments

x

Object to check

Value

The same object or NA if the object is null.

Examples

single_value(1)
#> [1] 1
single_value(NA)
#> [1] NA
single_value(NULL)
#> [1] NA
single_value(1:3)
#> [1] 1 2 3