
Are all elements in a list null or data.frames?
Source:R/all_list_elements.R
is_all_list_elements_null_or_df.RdChecks two things: that `x` is a list, and that all elements in `x` are `NULL` or data.frames.
See also
vignette("csutil", package = "csutil"), which runs all four
predicates on small example lists.
Other list predicates:
is_all_list_elements_null_or_fully_named_list(),
is_all_list_elements_null_or_list(),
is_fully_named_list()
Examples
is_all_list_elements_null_or_df(data.frame())
#> [1] FALSE
is_all_list_elements_null_or_df(list(data.frame()))
#> [1] TRUE
is_all_list_elements_null_or_df(list(1, NULL))
#> [1] FALSE
is_all_list_elements_null_or_df(list(data.frame(), NULL))
#> [1] TRUE
is_all_list_elements_null_or_df(list("a"=1, 2))
#> [1] FALSE