empty_to_na: Converts an empty vector to a scalar NA

View source: R/utils.R

empty_to_naR Documentation

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)

Arguments

x

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

Value

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


ramiromagno/gwasrapidd documentation built on Jan. 3, 2024, 10:21 p.m.