cut_number: Discretise numeric data into equal size groups

View source: R/utils-cut.R

cut_numberR Documentation

Discretise numeric data into equal size groups

Description

This function makes n groups with (approximately) equal numbers of observations

Usage

cut_number(x, n = NULL, ...)

Arguments

x

numeric vector

n

number of intervals to create

...

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.