Q:

R function to convert numeric (23) to English ("twenty-three")

Is there an R function that will convert numeric values to their English representation? It would work like this:
> to.words(5)
[1] "five"
> to.words(23)
[1] "twenty-three"

A:

There has been an example function for small numbers given on R-help :
http://finzi.psych.upenn.edu/Rhelp10/2008-March/155928.html
And there's another (which seems more complete) published by John Fox in the 5/1 volume of R news, starting page 51. The function itself is page 53 :
http://cran.r-project.org/doc/Rnews/Rnews_2005-1.pdf

A:

The number2words function you can find in the article "How Do You Spell That Number?" by John Fox in The Volume 5/1, May 2005 of RNews (you can download from here) is what you are looking for.

A:

There's now the english package:
library(english)

english(5)
english(23)

## > english(23)
## [1] twenty three
## > english(23)
## [1] twenty three

