View source: R/ch.getCombinationsOfOneVectorWithMods.r
ch.getCombinationsOfOneVectorWithMods | R Documentation |
This function generates the combinations of a single vector of items. Because this is a single vector version, there is often only one option displayed in a decision experiment (e.g., a "yes/no" experiment) This function intellegently combines the items with their modifiers. Specifically, one modifier will be randomly chosen to add to an item, and no group will be created so that there are two of the same items (regardless of their modifiers).
ch.getCombinationsOfOneVectorWithMods(
itemDataframe,
minNumPerSide = 1,
maxNumPerSide = 1,
sample = "all",
nStimPerGroup = 0
)
itemDataframe |
A dataframe that contains the items and the modifiers. The dataframe should be formatted as follows: Item <tab> Modifier <tab> Modifier <tab> Modifier ... |
minNumPerSide |
An integer that specifies the minimum number of items in the group. DEFAULT = 1 |
maxNumPerSide |
An integer that specifies the minimum number of items in the group. DEFAULT = 1 |
sample |
A string that specifies how to sample the items to create the combinations. The choices are: (1) "byGroup" for each group size (1, 2, etc) the sample size will equal nStimPerGroup; (2) "random" the entire set sample size will equal nStimPerGroup; (3) "all" all the combinations will be generated, without taking a sample (nStimPerGroup is ignored in this case). DEFAULT = "all" The samples will all be drawn randomly without replacement, unless the sample size is greater than the number of possible combinations. In that case the sample will be drawn randomly with replacement. |
nStimPerGroup |
An integer specifying the number of stim per group to select. If nStimPerGroup == 0, then the program will select all the single trials, and use that total as nStimPerGroup. DEFAULT = 0. |
dataframe with the all the combinations. The columns are labled IA.# to indicate they belong to the same group.:
ch.getCombinationsOfOneVectorWithMods (itemSet = c("item1","item2","item3", "item4"), minNumPerSide = 1, maxNumPerSide = 1, sample = "all", nStimPerGroup = 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.