quants | R Documentation |
This function lets the user quickly calculate cuts for quantiles and discretize numerical values into categorical values.
quants(values, splits = 10, return = "labels", n = 2)
values |
Vector. Values to calculate quantile cuts |
splits |
Integer. How many cuts should split the values? |
return |
Character. Return "summary" or "labels" |
n |
Integer. Determines the number of digits used in formatting the break numbers. |
Factor vector or data.frame. Depending on return
input:
labels
a factor ordered vector with each observation's quantile
summary
a data.frame with information on each quantile cut
Other Data Wrangling:
balance_data()
,
categ_reducer()
,
cleanText()
,
date_cuts()
,
date_feats()
,
file_name()
,
formatHTML()
,
holidays()
,
impute()
,
left()
,
normalize()
,
num_abbr()
,
ohe_commas()
,
ohse()
,
removenacols()
,
replaceall()
,
replacefactor()
,
textFeats()
,
textTokenizer()
,
vector2text()
,
year_month()
,
zerovar()
Other Calculus:
corr()
,
dist2d()
,
model_metrics()
data(dft) # Titanic dataset
quants(dft$Age, splits = 5, "summary")
quants(dft$Age, splits = 5, "labels")[1:10]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.