quantile_group: Partition a vector into quantile groups

View source: R/misc.R

quantile_groupR Documentation

Partition a vector into quantile groups

Description

Partitions a vector into quantile groups and returns a logical matrix indicating group membership.

Usage

quantile_group(x, cutoffs = c(0.25, 0.5, 0.75))

Arguments

x

A numeric vector to be partitioned.

cutoffs

A numeric vector denoting the quantile cutoffs for the partition. Default are the quartiles: c(0.25, 0.5, 0.75).

Value

An object of type "quantile_group", which is a logical matrix indicating group membership.

Examples

set.seed(1)
x <- runif(100)
cutoffs <- c(0.25, 0.5, 0.75)
quantile_group(x, cutoffs)


GenericML documentation built on June 18, 2022, 9:09 a.m.