Description Usage Arguments Details See Also
cn combines grammatical number awareness as in ngettext
with sprintf-like substitution for comma-concatenated text.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | cn(object, singular, plural = singular)
cn_and(object, singular, plural = singular)
cn_or(object, singular, plural = singular)
## S4 method for signature 'data.frame'
cn(object, singular, plural = singular)
## S4 method for signature 'data.frame'
cn_and(object, singular, plural = singular)
## S4 method for signature 'data.frame'
cn_or(object, singular, plural = singular)
|
object |
An n-vector, or |
singular |
The string to return if n = 1. |
plural |
The string to return if n is in 0, 2, 3, 4, ... |
Like 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.
cn_and uses cc_and instead of cc; cn_or
uses cc_or.
cc
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.