Learn R Programming

mefa (version 1.1-4)

qdef: Numeric Vector Conversion Based on Quantiles

Description

Converts a numeric vector into an ordinal one based on quantiles.

Usage

qdef(x, probs = seq(0, 1, 0.25))

Arguments

x
a numeric vector.
probs
numeric vector of probabilities with values in code{[0,1]} used by quantile.

Value

  • A vector of length the same as the input vector, containing integers from 1 to length(probs)-1.

See Also

quantile

Examples

Run this code
(vec <- rnorm(20))
(qd <- qdef(vec))
plot(vec, qd, type="h")

Run the code above in your browser using DataLab