Skip to contents

Drops any NULL entries from a named list. Useful for assembling filter or body lists before passing them to API helpers.

Usage

compact_list(x)

Arguments

x

A named list.

Value

A list with NULL elements removed.

Examples

compact_list(list(a = 1, b = NULL, c = "x"))
#> $a
#> [1] 1
#> 
#> $c
#> [1] "x"
#>