is_empty.Rd
Does an object contain anything?
is_empty(x, recursive = TRUE)
x | An R object, typically a |
---|---|
recursive |
|
logical
, whether x
contains anything.
library(salinasr) vec <- NULL vec#> NULLis_empty(vec)#> [1] TRUEnested_list <- list(a = list(b = list(c = list(d = NULL), e = NULL), f = NULL), g = NULL) nested_list#> $a #> $a$b #> $a$b$c #> $a$b$c$d #> NULL #> #> #> $a$b$e #> NULL #> #> #> $a$f #> NULL #> #> #> $g #> NULL #>is_empty(nested_list)#> [1] TRUEis_empty(nested_list, recursive = FALSE)#> [1] FALSE