Movatterモバイル変換


[0]ホーム

URL:


Skip to content
Esri Developer

General utility functions

Source:R/utils.R
utilities.Rd

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 viarlang::list2(...)

call

defaultrlang::caller_call().

x

a data.frame

Value

  • compact() a list

  • %||% the first non-null item orNULL if both areNULL

Details

  • compact() removes anyNULL list elements

  • %||% is a special pipe operator that returnsb ifa isNULL

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

Was this page helpful?

Your browser is no longer supported. Please upgrade your browser for the best experience. See ourbrowser deprecation post for more details.


[8]ページ先頭

©2009-2025 Movatter.jp