Learn R Programming

farsi (version 1.0)

sort.farsi: A sorting method for objects of class persian

Description

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

Usage

"sort"(x, decreasing = FALSE, ...)

Arguments

x
An object of class farsi.
decreasing
logical: should the object be sorted in decreasing order?
...
Not currently used.

Value

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

Details

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

References

See original note by Sadegh Rasoulinejad at

See Also

farsi.

Examples

Run this code
(x <- farsi(sample(1:100, 5)))
sort(x)

Run the code above in your browser using DataLab