Learn R Programming

gwasrapidd (version 0.99.17)

empty_to_na: Converts an empty vector to a scalar NA

Description

This function converts an empty vector to a scalar NA of the same type as the input.

Usage

empty_to_na(x)

Value

An atomic vector of the same type as x. If x is empty then NA is returned, otherwise x is returned as is.

Arguments

x

An atomic vector, of one of these types: character, integer, double or logical.