Learn R Programming

cba (version 0.2-25)

cut.ordered: Converting Ordered Factors

Description

Reduce the levels of an ordered factor.

Usage

# S3 method for ordered
cut(x, breaks, ...)

Value

An ordered factor.

Arguments

x

an ordered factor.

breaks

a logical, character, or index vector of cut points.

...

further (unused) arguments.

Author

Christian Buchta

Details

If breaks is of class logical it must have the same length as the number of levels of x.

If breaks is of class character partial matching with the levels of x is attempted.

Otherwise breaks is assumed to index the levels.

References

Functions Missing in R: A Never Ending Story ;-)

See Also

cut for converting numeric vectors to factor.

Examples

Run this code
x <- ordered(sample(letters[1:3],10,rep=TRUE))
cut(x, c(FALSE,TRUE,FALSE))
cut(x, "b")
cut(x, 2)

Run the code above in your browser using DataLab