removeNULL | R Documentation |
Unlike vectors, lists can hold objects with value NULL. This gets rid of them.
removeNULL(aList)
aList |
A list |
This version is NOT recursive
plyr::rbind.fill uses an experimental function that I choose to avoid. This is the "safe" version.
Same list with NULL's removed
Paul Johnson
## Note it is non-recursive, NULL remains in e x <- list(a = rnorm(5), b = NULL, c = rnorm(5), d = NULL, e = list(f = rnorm(2), g = NULL)) x removeNULL(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.