Description Usage Arguments Details Value Examples
This function is used to recode items (e.g., 1 = 4, 2 = 3, 3 = 2, 4 = 1).
1 | recode_items(items, original, recoded)
|
items |
Items to be recoded. |
original |
A vector containing the original coding of the variable (e.g., 1, 2, 3, 4). |
recoded |
A vector containing the recoding of the variable (e.g., 4, 3, 2, 1). "recoded" and "original" must be the same length. |
This function is mostly used inside scoring algorithms. Input can be vectors, matrices, or dataframes.
Recoded data are returned (usually questionnaire items).
1 2 3 4 5 6 | ## Not run:
recode_items(1:4, 1:4, c("A", "B", "C", "D"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.