list_drop_empty | R Documentation |
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(x)
x |
A list. |
vec_slice()
x <- list(1, NULL, integer(), 2)
list_drop_empty(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.