Create the default message used when a parameter is found to be a length greater than 1 (i.e. not a scalar).
Usage
dis_msg_scalar(class, stem, param = "param", call = rlang::caller_env())Arguments
- class
Required character scalar; the expected class of an object.
- stem
Required character scalar; the end of the error message containing an example of how to correctly format the input. For example, if you require a numeric scalar, you should include
stem = "{.code {param} = 1}.". See the documentation for theclipackage to find other formatting examples.- param
Required character scalar; the parameter name. The default matches the argument named for environments used through
disputeR.- call
Required environment; the environment in which the function was called. If nesting
dis_msg_class()within 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.
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.