Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

as.english

"_PACKAGE" Numbers in Englis Words


Description

Converts numerical vectors into object that display as English words

Usage

as.english(x, ...)

english(x, ...)

## Default S3 method:
english(x, ...)

## S3 method for class 'numeric'
english(x, UK, ...)

## S3 method for class 'english'
as.numeric(x, ...)

## S3 method for class 'english'
print(x, ...)

## S3 method for class 'english'
rep(x, ...)

## S3 method for class 'english'
x[i]

## S3 method for class 'english'
format(x, ...)

## S3 method for class 'english'
as.character(x, ...)

## S3 method for class 'english'
sort(x, decreasing = FALSE, ...)

Arguments

x

A numerical vector, usually integer.

...

Additional arguments passed on, currently mostly ignored

UK

Logical, Use the UK (English) style (TRUE) or the USA (American) style (FALSE). The default can be set as options(english.UK = TRUE); if unset, a suitable style is guessed from the user's current locale.

i

Index vector of any kind

decreasing

Logical: should the sorting be in decreasing order?

Value

A numerical object that can be printed as English words, or coerced to character as English words

Examples

english(10000) + (-5):5
set.seed(123)
(jumble <- english(sample(1:20)))
sort(jumble)
(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")

english

Translate Integers into English

v1.2-5
GPL-2
Authors
John Fox, Bill Venables, Anthony Damico and Anne Pier Salverda
Initial release
2020-01-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.