ncut: Cut into classes of equal size

Description Usage Arguments Value Author(s) Examples

Description

Cut a numeric vector into k classes of (roughly) equal size.

Usage

1
ncut(x, k = 10, labels = FALSE)

Arguments

x

numeric vector to cut.

k

the number of classes.

labels

Labels for the levels of the resulting category. By default (FALSE), labels are constructed using simple integer codes; if NULL, labels are build using "(a,b]" interval notation. Alternatively, a custom vector of length k can be used.

Value

A vector of k classes.

Author(s)

Mathieu Basille basille@ufl.edu and Emiel van Loon

Examples

1
2
3
4
5
6
bla <- rnorm(100)
summary(bla)
bli <- ncut(bla)
table(bli)
head(ncut(bla, labels = NULL))
head(ncut(bla, labels = LETTERS[1:10]))

basille/basr documentation built on May 11, 2019, 8:32 p.m.