powered by
list_drop_empty() removes empty elements from a list. This includes NULL elements along with empty vectors, like integer(0). This is equivalent to, but faster than, vec_slice(x, list_sizes(x) != 0L).
list_drop_empty()
NULL
integer(0)
vec_slice(x, list_sizes(x) != 0L)
list_drop_empty(x)
A list.
vec_slice()
x <- list(1, NULL, integer(), 2) list_drop_empty(x)
Run the code above in your browser using DataLab