ezCut: Convert numeric to factor

View source: R/util.R

ezCutR Documentation

Convert numeric to factor

Description

Cuts a numeric vector into factors using defined breaks.

Usage

ezCut(x, breaks, prefix = NULL, labels = NULL)

Arguments

x

a numeric vector to be cut.

breaks

The values by which the vector should be cut. 2 or more are needed.

prefix

adds a prefix to the level names.

labels

use labels for the factors instead of displaying the ranges provided by breaks.

Value

Returns the numeric input as factors.

Author(s)

Rehrauer, Hubert

Schmid, Peter

Examples

x = ezCut(1:10,breaks=c(2,5,7),prefix=letters[1:4])

uzh/ezRun documentation built on April 24, 2024, 4:01 p.m.