Skip to contents

This function checks if a data.frame has zero rows or zero columns.

Usage

# S3 method for data.frame
is.empty(x)

Arguments

x

A data.frame object

Value

A logical value: TRUE if the data.frame is empty, FALSE otherwise

Examples

df1 <- data.frame()
is.empty(df1)  # Returns TRUE
#> [1] TRUE

df2 <- data.frame(a = 1:3, b = letters[1:3])
is.empty(df2)  # Returns FALSE
#> [1] FALSE