A sorting method for objects of class english

Share:

Description

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

Usage

1
2
## S3 method for class '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.

Details

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

Value

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

Author(s)

Bill Venables

References

See original note by John Fox at http://tolstoy.newcastle.edu.au/R/help/05/04/2715.html.

See Also

english.

Examples

1
2
(x <- english(sample(1:100, 5)))
sort(x)