Skip to contents

Determine whether array is empty. An empty array, table, or timetable has at least one dimension with length 0, such as 0-by-0 or 0-by-5.

Usage

isempty(x)

Arguments

x

array

Value

A logical value determining if x is empty

Details

Emulates the behavior of the isempty function on Matlab

Examples

isempty(array(dim = c(0, 2, 2)))
#> [1] TRUE
isempty(matrix(rep(NA, 4), 2))
#> [1] FALSE
isempty(matrix(rep(0, 4), 2))
#> [1] FALSE
isempty(as.factor(c(NA, NA)))
#> [1] FALSE
isempty(factor())
#> [1] TRUE
isempty(matrix(rep("", 3)))
#> [1] FALSE