cutInterval: Cut a vector of numbers into interval factors.

Description Usage Arguments Value Author(s) See Also Examples

View source: R/factor.R

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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

Author(s)

Jitao David Zhang <jitao_david.zhang@roche.com>

See Also

cut

Examples

1
2
3
4
5
testNum <- rnorm(100)
(testFac <- cutInterval(testNum, step=1, labelOption="cut.default"))

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

ribiosUtils documentation built on March 13, 2020, 2:54 a.m.