Convert numbers to collective character vectors (the, both, all three)

collective(
  x,
  all_n = get_config("nombre::all_n", TRUE),
  of_the = get_config("nombre::of_the", FALSE),
  cardinal = get_config("nombre::coll_cardinal", TRUE),
  ...
)

nom_coll(
  x,
  all_n = get_config("nombre::all_n", TRUE),
  of_the = get_config("nombre::of_the", FALSE),
  cardinal = get_config("nombre::coll_cardinal", TRUE),
  ...
)

Arguments

x

A numeric vector.

all_n

Whether to include the cardinal number after "all" for collectives of 3 or more. Defaults to TRUE. Default can be changed with set_config("nombre::all_n").

of_the

Whether to include "of the" for collectives other than 1. Defaults to FALSE. Default can be changed with set_config("nombre::of").

cardinal

Whether to convert the number after "all" with cardinal() when all_n is TRUE. Defaults to TRUE. Default can be changed with set_config("nombre::coll_cardinal").

...

Additional arguments passed to cardinal() when cardinal is TRUE.

Value

A character vector of the same length as x.

See also

Other number names: adverbial(), cardinal(), denominator(), numerator(), ordinal()

Examples

paste(nom_coll(0:3), "fish")
#> [1] "no fish" "the fish" "both fish" "all three fish"
paste(nom_coll(9:12, max_n = 10), "fish")
#> [1] "all nine fish" "all ten fish" "all 11 fish" "all 12 fish"