pl | R Documentation |
Converts a word into a plural (English).
pl(singular, num, irregular = NULL)
singular |
Singular form of the word |
num |
Number of items. |
irregular |
Plural form of the word in the case where it is irregular and needs to be explicitly specified. |
This function would usually be used in a context where the number of items
num
is a variable and not known at run-time.
Either the singular or plural form of the word, depending on the
value of num
.
pl("shoe", 2) pl("shoe", 1) n <- 0 pl("thing", n) pl("sheep", 5) # => incorrect (gives "sheeps") pl("sheep", 5, "sheep") # => correct (gives "sheep")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.