Learn R Programming

ribiosUtils (version 1.5-6)

cutInterval: Cut a vector of numbers into interval factors.

Description

Three types of labels (levels) are supported: “cut.default” (Interval labels returned by cut as default), “left” (Left boundary of intervals), and “right” (Right boundary of intervals).

Usage

cutInterval(
  x,
  step = 1,
  labelOption = c("cut.default", "left", "right"),
  include.lowest = FALSE,
  right = TRUE,
  dig.lab = 3,
  ordered_result = FALSE,
  ...
)

Arguments

x

A vector of numbers

step

Step size.

labelOption

How is the label displayed.See details section.

include.lowest

Logical, passed to cut

right

Logial, passed to cut

dig.lab

See cut

ordered_result

See cut

Other parameters that are passed to cut

Value

A vector of factors

See Also

cut

Examples

Run this code
# NOT RUN {
testNum <- rnorm(100)
(testFac <- cutInterval(testNum, step=1, labelOption="cut.default"))

## compare the result to
(testFacCut <- cut(testNum, 10))

# }

Run the code above in your browser using DataLab