Description Usage Arguments Value Examples
View source: R/fitting_functions.R
Transform a vector into consecutive integers
1 | labelled_integer(x = vector())
|
x |
A vector, which may be numeric, string, or factor. |
A vector of integers corresponding to entries in x
.
The lowest value will be 1, and the greatest value will equal the number of
unique elements in x
.
The elements of the recoded vector are named according to the original
values of x
.
The result is suitable for the ii
and jj
options for
irt_data
.
1 2 3 4 5 6 7 8 | x <- c("owl", "cat", "pony", "cat")
labelled_integer(x)
y <- as.factor(x)
labelled_integer(y)
z <- rep(c(22, 57, 13), times = 2)
labelled_integer(z)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.