View source: R/buildRandomImage4PCA.R
recode2Integer | R Documentation |
recode2Integer
:
Recodes a vector of real values to integers matching
a given distribution for the integers
recode2Integer(original.var, toBeScaled.var)
original.var |
A vector of integers (e.g., Likert scale), used to derive the distribution of the integers. |
toBeScaled.var |
a vector of real values to be recoded
as integers (with the same distribution as |
recode2Integer
: can be used to
transform a vector or real numbers to a vector of integers
such as, for example, the score obtained from a Likert scale.
Note that the more elements the original vector has, the better
the quality of the transformation, because ties can create problem
wih small samples.
A vector of integers matching the distribution
of the integers in original.var
.
Hervé Abdi
set.seed(42)
toto <- rnorm(1:10)
toto.scaled <- recode2Integer(c(1,1,1,3,4,4,1,2,2,4), toto)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.