Skip to contents

Exclude all NULL Entries from a List

Usage

excludeNULL(x, dbg = TRUE)

Arguments

x

a list

dbg

if TRUE (default) a message is shown if elements are removed

Value

list x with all NULL entries excluded

Examples

L <- list(a = 1, b = NULL, c = "three")
L
#> $a
#> [1] 1
#> 
#> $b
#> NULL
#> 
#> $c
#> [1] "three"
#> 

excludeNULL(L)
#> Removing 1 list elements that are NULL ... ok. (0.00 secs) 
#> $a
#> [1] 1
#> 
#> $c
#> [1] "three"
#>