as.roman
Display Integers As Roman Numerals
Description
Store integers with class "roman" so they print as Roman numerals.
Usage
as.roman(x)
## S3 method for class 'roman':
as.character(x, ...)
## S3 method for class 'roman':
format(x, ...)
## S3 method for class 'roman':
print(x, ...)
## S3 method for class 'roman':
x[i]
Arguments
x |
An integer vector you wish to have diplayed as Roman numerals.
The values should be between 1 and 3899, inclusive.
|
i |
The subscript vector, as with the generic subscript operator.
Only one subscript is allowed.
|
Value
as.roman(x) returns the as.integer(x)
with the class "roman" attached. If any values
in x are outside the range 1-3899 they
will be converted to NA.
as.character(x), where x has class "roman",
returns a character vector containing
the uppercase Roman numerals for the values in x.
format(x) returns format(as.character(x))
and print(x) calls print(as.character(x), quote=FALSE)
and returns x.
Examples
as.roman(1:20)