ordered
Create an Ordered factor Object
Description
Return an object with class ordered and class factor.
Usage
ordered(x, ...)
is.ordered(x)
as.ordered(x)
Arguments
x |
data to be made into an ordered factor.
|
... |
one or more appropriate object(s).
|
Value
ordered | returns an ordered factor: that is,
an object of class c("ordered", "factor"). |
is.ordered | returns TRUE if x
inherits from class "ordered"; otherwise, it returns FALSE. |
as.ordered | returns x if x is ordered; otherwise, it
returns ordered(x). |
See Also
Examples
someColors <- ordered(c("red","blue","red","green"),
levels=c("red","orange","yellow","green","blue","indigo","violet"))
someColors
class(someColors)
is.ordered(someColors)
max(someColors)