Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

xtile

Split a numeric variable into a number of bins and return a vector of bin numbers


Description

Split a numeric variable into a number of bins and return a vector of bin numbers

Usage

xtile(x, n = 5, rev = FALSE, type = 7)

Arguments

x

Numeric variable

n

number of bins to create

rev

Reverse the order of the bin numbers

type

An integer between 1 and 9 to select one of the quantile algorithms described in the help for the stats::quantile function

See Also

See quantile for a description of the different algorithm types

Examples

xtile(1:10, 5)
xtile(1:10, 5, rev = TRUE)
xtile(c(rep(1, 6), 7:10), 5)

radiant.data

Data Menu for Radiant: Business Analytics using R and Shiny

v1.3.12
AGPL-3 | file LICENSE
Authors
Vincent Nijs [aut, cre]
Initial release
2020-11-25

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.