Skip to contents

This function returns the correct indefinite article based on the class of the input.

Usage

dis_indefinite(x, indefinite_class = NULL)

Arguments

x

Required object; a parameter argument to test.

indefinite_class

Optional character vector; if the class of an object is listed here, and class(x) matches this class, the function will return "an".

Value

If the input is an integer or the class of the input is included in indefinite_class, the function will return "an". Otherwise, the function will return "a".

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.

Examples

dis_indefinite(x = "test")
#> [1] "a"
dis_indefinite(x = 2)
#> [1] "a"