Format a type for error messages

friendly_type(type)

Arguments

type

A type as returned by type_of() or lang_type_of().

Value

A string of the prettified type, qualified with an indefinite article.

Examples

friendly_type("logical")
#> [1] "a logical vector"
friendly_type("integer")
#> [1] "an integer vector"
friendly_type("string")
#> [1] "a string"