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

View source: R/ch.getCombinationsOfOneVector.r

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

Description

This function to creates a data frame composed of one sets of combinations. It creates a data frame for Combination A (take n items r at a time, order doesn't matter).

Usage

ch.getCombinationsOfOneVector(
  itemSet,
  minNumPerSide = 1,
  maxNumPerSide = 2,
  sample = "all",
  nStimPerGroup = 0
)

Arguments

minNumPerSide

An integer that specifies the minimum number of items in group. DEFAULT = 1

maxNumPerSide

An integer that specifies the minimum number of items in 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.

data

A vector of items that will be combined.

Value

dataframe with the all the combinations. The columns are labled IA.# and IB.# to indicate the group.:

Examples

ch.getCombinationsOfOneVector (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.