Skip to content
Prev 30578 / 398506 Next

removing NULL elements from a list

you can also modify the original list "in place":

l[sapply(l, is.null)] <- NULL


I don't understand why it works this way especially given that, for example,

l[sapply(l, is.null)] <- 5

simply replaces NULL elements of the list with 5. This probably has to do
with the special semantics of NULL. I'd appreciate if someone could clearify
this for me.

Thanks,
Vadim
-------------------------------------------------- 
DISCLAIMER\ This e-mail, and any attachments thereto, is intende... {{dropped}}