Skip to contents

Return NA if an object is empty.

Usage

na_empty(x)

Arguments

x

An object.

Value

NA if x is empty (length(x) == 0), otherwise x.

Examples

na_empty(integer())
#> [1] NA