powered by
This function converts an empty vector to a scalar NA of the same type as the input.
empty_to_na(x)
An atomic vector of the same type as x. If x is empty then NA is returned, otherwise x is returned as is.
x
NA
An atomic vector, of one of these types: character, integer, double or logical.
character
integer
double
logical