How do I remove the null elements from a list of lists, like below, in R:
lll <- list(list(NULL),list(1),list(\"a\"))
The object I want
Since you have lists in lists, you probably need to run l/sapply twice, like:
l/sapply
lll[!sapply(lll,sapply,is.null)] #[[1]] #[[1]][[1]] #[1] 1 # # #[[2]] #[[2]][[1]] #[1] "a"