divide: Divide a vector into three groups

View source: R/divide.R

divideR Documentation

Divide a vector into three groups

Description

Divide a vector into three groups

Usage

divide(x, criterion = "1sd")

Arguments

x

A numeric vector.

criterion

A character value "1sd" or a numeric value between 0 and 0.5.

Details

divide() divides a vector into three groups using the criterion of 1 SD, or proportions like 0.27. Differing from cut(), the medium interval of divide() does not include the left and right limits.

Value

An ordered factor with levels "Low < Medium < High".

Examples

x <- 1:100
divide(x)
divide(x, 0.27)

Keng documentation built on Sept. 1, 2026, 5:07 p.m.