Remove NULL elements from a list in R

If you have a list with NULL elements, the following will remove them:

A[!sapply(A, is.null)]

A is the list. Functions referenced:

Source: R-help

Follow

Get every new post delivered to your Inbox.