remove NULL entries from list
Value
list with NULL entries either removed, or replaced with nullValue. This function is typically called so it removed list elements which are NULL, resulting in a list that contains non-NULL entries. This function can also be useful when NULL values should be changed to something else, perhaps a character value "NULL" to be used as a label.
Details
This function is a simple helper function to remove NULL from a list, optionally replacing it with another value
See also
Other jam practical functions:
breakDensity()
,
call_fn_ellipsis()
,
checkLightMode()
,
check_pkg_installed()
,
colNum2excelName()
,
color_dither()
,
exp2signed()
,
getAxisLabel()
,
isFALSEV()
,
isTRUEV()
,
jargs()
,
kable_coloring()
,
lldf()
,
log2signed()
,
middle()
,
minorLogTicks()
,
newestFile()
,
printDebug()
,
reload_rmarkdown_cache()
,
renameColumn()
,
rmInfinite()
,
rmNA()
,
rmNAs()
,
setPrompt()
Examples
x <- list(A=1:6, B=NULL, C=letters[11:16]);
rmNULL(x)
#> $A
#> [1] 1 2 3 4 5 6
#>
#> $C
#> [1] "k" "l" "m" "n" "o" "p"
#>
rmNULL(x, nullValue=NA)
#> $A
#> [1] 1 2 3 4 5 6
#>
#> $B
#> [1] NA
#>
#> $C
#> [1] "k" "l" "m" "n" "o" "p"
#>