[ top | up ]

Convert Numeric to Factor

Syntax

cut(x, breaks, labels)

Arguments

x a numeric vector which is to be converted to a factor by cutting.
break either a vector of cut points or number giving the number of intervals which x is to be cut into.
labels labels for the levels of the resulting category.

Value

cut divides the range of x into intervals and codes the values in x according to which interval they fall. The leftmost interval corresponds to level one, the next leftmost to level two and so on. If a labels parameter is specified, its values are used to name the factor levels. If none is specified, the factor level labels are taken to be "Range 1", "Range 2", etc.

See Also

factor, tabulate.