General utility functions
General utility functions
Usage
compact(.x)a%||%bcheck_dots_named(dots, call=rlang::caller_env())data_frame(x, call=rlang::caller_call())Arguments
- .x
a list
- a
an R object
- b
an R object
- dots
a list collected from dots via
rlang::list2(...)- call
default
rlang::caller_call().- x
a data.frame
Details
compact()removes anyNULLlist elements%||%is a special pipe operator that returnsbifaisNULL
Examples
# remove null elementscompact(list(a=NULL, b=1))#> $b#> [1] 1#># if NULL return rhsNULL%||%123#> [1] 123# if not NULL return lhs123%||%NULL#> [1] 123