index_group: Create group index by partitioning a vector.

View source: R/utils_partition.R

index_groupR Documentation

Create group index by partitioning a vector.

Description

Create group index by partitioning a vector.

Usage

index_group(x, k = NULL, length = NULL, method)

Arguments

x

vector to index

k

number of group, integer

length

length of each group

method

discretization method.

  • fixed, fixed size groups, remainder creates an incomplete group

  • quantiles, breaks are defined by quantile probabilities as a function of group number and noise

  • random, breaks are randomly sampled in the vector range as a function of group number.

  • hclust, are defined by 1D hierarchical clustering.

Value

a vector of indices of the same length as x


picasa/generate documentation built on Feb. 28, 2025, 6:51 a.m.