is_empty: Check if a 'R' object is indeed empty

Description Usage Arguments Value Examples

View source: R/is_empty.R

Description

A helper function to check whether a R object is indeed empty mostly used internally.

Usage

1
is_empty(x, trim = TRUE)

Arguments

x

a R object

trim

a logical scalar which controls to trim leading and trailing whitespaces with a character input.

Value

a logical vector.

Examples

1
2
3
4
5
6
7
8
# Empty strings
is_empty(" ")               # TRUE
is_empty(character(0))      # TRUE
is_empty(" ", trim = FALSE) # FALSE

# Case where it returns TRUE
is_empty(0)
is_empty(numeric(0))

tstev/tstevR documentation built on May 18, 2020, 10:57 p.m.