cut.ordered {cba}R Documentation

Converting Ordered Factors

Description

Reduce the levels of an ordered factor.

Usage

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

Arguments

x

an ordered factor.

breaks

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

...

further (unused) arguments.

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.

Value

An ordered factor.

Author(s)

Christian Buchta

References

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

See Also

cut for converting numeric vectors to factor.

Examples

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

[Package cba version 0.2-24 Index]