Create Category by Cutting Continuous Data

DESCRIPTION:
Creates a category object by dividing continuous data into intervals. Either specific cut points or the number of equal width intervals can be specified.

USAGE:
cut(x, ...)

cut.default(x, breaks, labels=<<see below>>, include.lowest = F)


REQUIRED ARGUMENTS:
x:
data vector. Missing values (NAs) are allowed.
breaks:
either a vector of breakpoints, or the number of equal-width intervals into which the data in x should be cut. If a vector of breakpoints is given, the category will have length(breaks)-1 groups, corresponding to data in the intervals between successive values in breaks (breaks must be sorted).

OPTIONAL ARGUMENTS:
labels:
character vector of labels for the intervals. The default is to encode the breakpoints to make up interval names, in the form "lower.limit+ thru upper.limit".
include.lowest:
If TRUE, then make the lowest bin include its lower endpoint, otherwise (the default) make the lowest bin act like the others, which include the upper endpoint but not the lower.

VALUE:
a vector as long as x telling which group each point in x belongs to, along with an attribute, levels, which is a vector of character names for each group.

DETAILS:
Data less than or equal to the first breakpoint or greater than the last breakpoint are returned as NA. Each group consists of data greater than one breakpoint and less than or equal to the next breakpoint. (However, if include.lowest is TRUE, the bottommost group also includes data equal to the lowest breakpoint.) Missing values in x create missing values in the result.

The cut function is generic.


SEE ALSO:
cut.dates , category , table , tapply .

EXAMPLES:
cut(x, 3)   # cut into 3 groups
cut(x, breaks)  # cut based on given breakpoints
cut(x, pretty(x))   # approx 5 "pretty" intervals