cut.ordered: Converting Ordered Factors

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/cut.ordered.r

Description

Reduce the levels of an ordered factor.

Usage

1
2
## 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

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

cba documentation built on May 2, 2019, 1:39 p.m.

Related to cut.ordered in cba...