ch.getCombinationsOfOneVectorWithMods: A function to creates a data frame composed of one sets of...

View source: R/ch.getCombinationsOfOneVectorWithMods.r

ch.getCombinationsOfOneVectorWithModsR Documentation

A function to creates a data frame composed of one sets of combinations (take n items r at a time, order doesn't matter) with intellegent use of modifiers.

Description

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).

Usage

ch.getCombinationsOfOneVectorWithMods(
  itemDataframe,
  minNumPerSide = 1,
  maxNumPerSide = 1,
  sample = "all",
  nStimPerGroup = 0
)

Arguments

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.

Value

dataframe with the all the combinations. The columns are labled IA.# to indicate they belong to the same group.:

Examples

ch.getCombinationsOfOneVectorWithMods (itemSet = c("item1","item2","item3", "item4"), minNumPerSide = 1, maxNumPerSide = 1, sample = "all", nStimPerGroup = 0)

ccpluncw/ccpl_R_chValues documentation built on Feb. 12, 2024, 4:21 a.m.