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
orderedreturns an ordered factor: that is, an object of class c("ordered", "factor").
is.orderedreturns TRUE if x inherits from class "ordered"; otherwise, it returns FALSE.
as.orderedreturns x if x is ordered; otherwise, it returns ordered(x).
See Also
factor,levels
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)
Package base version 6.0.0-69
Package Index