If item-stimulus hierarchies are stored in a single stimulus column,
stemInclusionTuples
transforms this format into item pairs ('tuples').
Details
Inclusion tuples can be used by itemInclusionConstraint
to set up inclusion constraints.
Examples
# Example data.frame
inclDF <- data.frame(ID = paste0("item_", 1:6),
stem = c(rep("stim_1", 3), "stim_3", "stim_4", "stim_3"),
stringsAsFactors = FALSE)
# Create tuples
stemInclusionTuples(inclDF, idCol = "ID", stemCol = "stem")
#> [,1] [,2]
#> [1,] "item_1" "item_2"
#> [2,] "item_1" "item_3"
#> [3,] "item_2" "item_3"
#> [4,] "item_4" "item_6"