words: Express Numbers in Words

Description Usage Arguments Value Examples

View source: R/words.R

Description

Convert numerical objects to Enghish character strings. A convenience function for use mainly with RMarkdown in-text inserts. The capitalized version, Words, makes the initial letter of the result upper case.

Usage

1
2
3
words(x)

Words(x)

Arguments

x

A numeric vector, usually integer

Value

A character string vector with the numbers expressed in English words.

Examples

1
2
cat("The Duke of York had ", words(10006), " men.\n", sep = "")
cat("How many did he have? ", Words(10006), ".\n", sep = "")

Example output

The Duke of York had ten thousand and six men.
How many did he have? Ten thousand and six.

english documentation built on Aug. 21, 2021, 9:07 a.m.