powered by
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)
Vector. Values to calculate quantile cuts
Integer. How many cuts should split the values?
Character. Return "summary" or "labels"
Integer. Determines the number of digits used in formatting the break numbers.
Factor vector or data.frame. Depending on return input:
return
labels a factor ordered vector with each observation's quantile
labels
summary a data.frame with information on each quantile cut
summary
Other Calculus: corr(), dist2d(), model_metrics()
corr()
dist2d()
model_metrics()
# NOT RUN { data(dft) # Titanic dataset quants(dft$Age, splits = 5, "summary") quants(dft$Age, splits = 5, "labels")[1:10] # }
Run the code above in your browser using DataLab