Description Usage Arguments Details Value Examples
View source: R/jamie-internals.R
This function is used to recode items within a matrix (e.g., 1 = 4, 2 = 3, 3 = 2, 4 = 1).
1 | recode_items_in_matrix(items_matrix, original, recoded)
|
items_matrix |
A matrix containing 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. |
The input must be a matrix or an error will result.
A matrix of recoded data are returned (usually questionnaire items).
1 2 3 4 | ## Not run:
score_items_in_matrix(as.matrix(a_dataframe[some_items]))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.