cn
combines grammatical number awareness as in ngettext
with sprintf
-like substitution for comma-concatenated text.
cn(object, singular, plural = singular)
cn_and(object, singular, plural = singular)
cn_or(object, singular, plural = singular)
"cn"(object, singular, plural = singular)
"cn_and"(object, singular, plural = singular)
"cn_or"(object, singular, plural = singular)
data.frame
with n rows.ngettext
, this function returns one string to be used with a
singular referent and another with a plural referent. cn
chooses
between the two based on the length of its first argument, object
, or
if object
is a data.frame
, its row count.Two substitions are made sprintf
-style. "%n
" is replaced with
the number of object
, and "%c
" is replaced with the
comma-concatenated values of object
, as in cc
.