This function returns a standard error message for NULL
parameters that are not allowed to be NULL, i.e. if
null_valid = FALSE.
Usage
dis_null(x, class, null_valid, param = rlang::caller_arg(x),
call = rlang::caller_env(), fact_check = "global")Arguments
- x
Required object; a parameter argument to test.
- class
Required character scalar; the expected type of the parameter.
- null_valid
Required logical scalar; whether the parameter can be
NULL. IfFALSE, the function will throw an error ifxisNULL. IfTRUE, the function will not throw an error ifxisNULL.- param
Required character scalar; the parameter name. The default uses
rlang::caller_arg(x)to pull the parameter name passed toxby the functiondis_null()is nested within. This value can also be set to a static character scalar.- call
Required environment; the environment in which the function was called. If nesting
dis_not_missingwithin another function, it is recommended to provide the calling environment to ensure the correct environment is referenced usingrlang::caller_env()(default). If there are multiple levels of nesting, thecallargument can be used to pass an environment created in the outermost function.- fact_check
Required character scalar; whether to override fact checking environment setting. If
"global"(default),dis_characterwill follow the global setting. If"always",dis_characterwill ignore any global setting and will always checkx. This argument is primarily intended for Shiny developers who wish to usedisputeRin modules. See the vignette onvignette("developing", package = "disputeR")for details on how to use this function.
Value
This function will return an error message for NULL parameters
that are not allowed to be NULL. Otherwise, no output is returned.
Details
See the vignette on vignette("developing", package = "disputeR")
for details about internal validation of arguments for this function. Unlike
the core functions, dis_param does not have a fact_check
argument. The vignette("developing", package = "disputeR") vignette
includes details on how to implement that functionality around dis_param.