| sort.english {english} | R Documentation |
A method for the generic function sort which allows numeric
objects of class english to be sorted.
## S3 method for class 'english' sort(x, decreasing = FALSE, ...)
x |
An object of class |
decreasing |
logical: should the object be sorted in decreasing order? |
... |
Not currently used. |
The method temporarily removes the english class, sorts the
object components and reinstates the english class to the result.
An object of class english with its components in numerically
sorted order.
John Fox and Bill Venables
See original note by John Fox in the Programmers Niche section of https://cran.r-project.org/doc/Rnews/Rnews_2005-1.pdf.
set.seed(1010) x <- english(sample(1:100, 5)) noquote(matrix(as.character(x))) noquote(matrix(as.character(sort(x))))