Convert a key vector to a list of question indices by dimension
Source:R/FUNCTIONS_KEYS.R
questions_by_keys.RdTakes a scoring key that maps each question to a dimension and returns a list where each element contains the indices of questions belonging to that dimension.
Value
A named list of length max(key), where element i contains
the integer indices of all questions assigned to dimension i.
Examples
key<-c(1,2,3,4,5,1,2,3,4,5)
questions_by_keys(key)
#> [[1]]
#> [1] 1 6
#>
#> [[2]]
#> [1] 2 7
#>
#> [[3]]
#> [1] 3 8
#>
#> [[4]]
#> [1] 4 9
#>
#> [[5]]
#> [1] 5 10
#>