Learn R Programming

broman (version 0.84)

spell_out: Spell out an integer

Description

Spell out an integer as a word, for use in reports/papers.

Usage

spell_out(number, capitalize = FALSE, max_value = 9)

Value

Character string (or vector of character strings) with numbers spelled out, or as numerals if large.

Arguments

number

A number that is to be spelled out (can be a vector).

capitalize

If TRUE, capitalize the first letter.

max_value

Maximum value to use (generally 9); if larger than this, use numerals.

Examples

Run this code
spell_out(9)
spell_out(9, cap=TRUE)
spell_out(9, max_value=5)

Run the code above in your browser using DataLab