is_empty: Check whether string, list or vector is empty

Description Usage Arguments Value Note

Description

This function checks whether a string or character vector (of length 1), a list or any vector (numeric, atomic) is empty or not. From sjmisc.

Usage

1
is_empty(x, first.only = TRUE)

Arguments

x

String, character vector, list, data.frame or numeric vector or factor.

first.only

Logical, if FALSE and x is a character vector, each element of x will be checked if empty. If TRUE, only the first element of x will be checked.

Value

Logical, TRUE if x is a character vector or string and is empty, TRUE if x is a vector or list and of length 0, FALSE otherwise.

Note

NULL- or NA-values are also considered as "empty" (see 'Examples') and will return TRUE.


grahamstewart12/tidyflux documentation built on June 4, 2019, 7:44 a.m.