cut_interval: Discretise numeric data into equal ranges

View source: R/utils-cut.R

cut_intervalR Documentation

Discretise numeric data into equal ranges

Description

This function makes n groups with equal range

Usage

cut_interval(x, n = NULL, length = NULL, ...)

Arguments

x

numeric vector

n

number of intervals to create, OR

length

length of each interval

...

Arguments passed on to base::cut.default

breaks

either a numeric vector of two or more unique cut points or a single number (greater than or equal to 2) giving the number of intervals into which x is to be cut.

labels

labels for the levels of the resulting category. By default, labels are constructed using "(a,b]" interval notation. If labels = FALSE, simple integer codes are returned instead of a factor.

right

logical, indicating if the intervals should be closed on the right (and open on the left) or vice versa.

dig.lab

integer which is used when labels are not given. It determines the number of digits used in formatting the break numbers.

ordered_result

logical: should the result be an ordered factor?


VEuPathDB/veupathUtils documentation built on Feb. 8, 2025, 12:29 p.m.