powered by
Remove empty elements from lists
compact_list(x, remove_na = FALSE)
A list or vector.
Logical to decide if NAs should be removed.
NA
compact_list(list(NULL, 1, c(NA, NA))) compact_list(c(1, NA, NA)) compact_list(c(1, NA, NA), remove_na = TRUE)
Run the code above in your browser using DataLab