Learn R Programming

english (version 1.2-2)

english-package: English

Description

Allow numbers to be presented in an English language version, one, two, three, ...

Arguments

Details

In answer to a question on R-help John Fox provided an elegant R function to translate integers into English numbers. The present package extends this code to an S3 class, with constructor functions and methods to make this original idea more conveniently available.

The function as.english is intended to provide a parallel facility to the function as.roman in the utils package.

The main purpose of the package is to present an interesting programming example rather than to solve a likely real problem, though there could well be some applications in unusual contexts.

Note added in Version 1.1-4. The two small helper functions words and Words are included to facilitate inline code inserts in R markdown files. See the help files for examples. The ordinal function produces character strings and may be used directly in inline code inserts. Use `r words(10000)` rather than `r english(10000)` in R markdown files.

Note added in Version 1.2-0. The function indefinite added for algorithmically including an apprporiate indefinite article in a document insert. Based on a suggestion of Anne Pier Salverda.

The capitalized version, Indefinite added in 1.2-1, and a vignette added in 1.2-2.