| itemTuples | R Documentation | 
If item inclusions or exclusions are stored as a character vector, itemTuples separates this vector and creates item pairs ('tuples').
itemTuples(items, idCol = "ID", infoCol, sepPattern = ", ")
items | 
 A   | 
idCol | 
 character or integer indicating the item ID column in   | 
infoCol | 
 character or integer indicating the column in   | 
sepPattern | 
 String which should be used for separating item IDs in the   | 
Tuples can be used by itemExclusionConstraint to set up exclusion constraints
and by itemInclusionConstraint to set up inclusion constraints. Note that a
separator pattern has to be used consistently throughout the column (e.g. ", ").
A data.frame with two columns.
# Example data.frame
items <- data.frame(ID = c("item1", "item2", "item3", "item4"),
                     exclusions = c("item2, item3", NA, NA, NA))
# Create tuples
itemTuples(items = items, idCol = "ID", infoCol = 2,
                    sepPattern = ", ")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.