Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

is.empty

Test for Empty Characters


Description

is.empty returns whether elements of a character vector are empty (i.e., "").

Usage

is.empty(x, trim = FALSE)

Arguments

x

character vector.

trim

logical vector with a single element specifying whether white spaces should be trimmed from the character vector. See trimws.

Value

TRUE for every element of 'x' that is empty (i.e., "") and FALSE otherwise. The structure is a logical vector with length = length('x') and names = names('x').

Examples

v <- c("1", " ", "")
is.empty(v)

str2str

Convert R Objects from One Structure to Another

v0.1.1
GPL (>= 2)
Authors
David Disabato [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.