If x is an sf object invisibly return TRUE. If not, return an error with cli::cli_abort
Usage
check_sf(
x,
...,
ext = FALSE,
allow_list = FALSE,
allow_null = FALSE,
arg = caller_arg(x),
call = caller_env()
)Arguments
- x
An
sf,sfc, orbboxobject.- ...
Additional parameters passed to
rlang::abort().- ext
If
TRUE, check if x is asf,sfc, orbboxclass object or not; defaults toFALSE. (used by is_sf)- allow_list
If
TRUE, returnTRUEif x is an sf list or, if ext is alsoTRUE, a list of sf, sfc, or bbox objects. Defaults toFALSE.- allow_null
If
TRUEand x isNULL, returnTRUE; defaults toFALSE.- arg
An argument name as a string. This argument will be mentioned in error messages as the input that is at the origin of a problem.
- call
The execution environment of a currently running function, e.g.
caller_env(). The function will be mentioned in error messages as the source of the error. See thecallargument ofabort()for more information.
