CutModules: Cut a numeric variable into intervals

CutModulesR Documentation

Cut a numeric variable into intervals

Description

Similar to cut2 function with some modification.

Usage

CutModules(x, cuts, m, g, levels.mean = FALSE, digits, minmax = TRUE,
    oneval = TRUE, onlycuts = FALSE)

Arguments

x

Numeric vector to classify into intervals.

cuts

Cut points

m

Desired minimum number of observations in a group.

g

Number of quantile groups.

levels.mean

Set to TRUE to make the new categorical vector have levels attribute that is the group means of x instead of interval endpoint labels.

digits

Number of significant digits to use in constructing levels. The default is 3, and 5 if levels.mean = TRUE.

minmax

If cuts is specified but min(x) < min(cuts) or max(x) > max(cuts) augments cuts to include min and max x.

oneval

If an interval contains only one unique value, the interval will be labeled with the formatted version of that value instead of the interval endpoints unless oneval = FALSE.

onlycuts

Set to TRUE to only return the vector of computed cuts. This consists of the interior values plus outer ranges.

Value

Vector

Author(s)

Md Bahadur Badsha (mbbadshar@gmail.com)


audreyqyfu/mrpc2 documentation built on April 17, 2022, 7:36 a.m.