words {english}R Documentation

Convert integers to words as character strings

Description

Convenience functions mainly for use in R markdown inline code inserts. words converts an numeric or english object to character strings; Words does the same job, but additionally changes the first letter of the output strings to upper case, as needed if the R markdown code insert begins a sentence.

Usage

words(x) ## lower case
Words(x) ## capitalized initial letter

Arguments

x

Either a numerical vector of integers or an english object.

Details

Convenience functions only. Intended primarily for use in R markdown code inserts.

Value

A character string vector representing the input numerical object in English words.

Note

In inline code inserts in R markdown, functions like cat do not produce output. Some print methods, including print.english also do not produce output. As such inline code inserts require a character string output only, these convenience functions are designed to facilitate that process.

Author(s)

Bill Venables.

See Also

as.character.english

Examples

  paste("The Duke of York had", words(10006), "men")
  paste("How many?", Words(10006))

[Package english version 1.1-4 Index]