english (version 1.1-3)

sort.english: A sorting method for objects of class english

Description

A method for the generic function sort which allows numeric objects of class english to be sorted.

Usage

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

Arguments

x

An object of class english.

decreasing

logical: should the object be sorted in decreasing order?

Not currently used.

Value

An object of class english with its components in numerically sorted order.

Details

The method temporarily removes the english class, sorts the object components and reinstates the english class to the result.

References

See original note by John Fox in the Programmers Niche section of https://cran.r-project.org/doc/Rnews/Rnews_2005-1.pdf.

See Also

english.

Examples

Run this code
# NOT RUN {
set.seed(1010)
x <- english(sample(1:100, 5))
noquote(matrix(as.character(x)))
noquote(matrix(as.character(sort(x))))
# }

Run the code above in your browser using DataCamp Workspace