Learn R Programming

english (version 1.1-3)

english-package: English

Description

A simple facility to provide an english language representation of integer vectors.

Arguments

Details

Package: english
Type: Package
Version: 1.1-3
Date: 2018-05-19
License: GPL-2
LazyLoad: yes

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.

References

See original note by John Fox in the Programmers Niche section of https://cran.r-project.org/doc/Rnews/Rnews_2005-1.pdf.

See Also

as.roman.

Examples

Run this code
# NOT RUN {
english(1:10)^2 + 1:10
(x <- english(sample(1:100, 10)))
sort(x)
toupper(english(1:10))
## For mothers of small children:
cat(paste("This is the", ordinal(1:5), "time I've told you!"), sep = "\n")
# }

Run the code above in your browser using DataLab