apply_combo_rules: selects item combinations based on defined rules

View source: R/apply_combo_rules.R

apply_combo_rulesR Documentation

selects item combinations based on defined rules

Description

selects item combinations based on defined rules

Usage

apply_combo_rules(
  full,
  combo_length = 4:length(full),
  forced_items = NULL,
  rules = NULL,
  ignoreCores = 1
)

Arguments

full

a numeric vector containing the the source for the combinations, typically the indices of the items in the referring dataset

combo_length

a numeric vector with the allowed lengths of the selected combinations (scale lengths)

forced_items

a numeric vector of items that are forced to occur in every selected combination

rules

a list defining rules for combination selection

ignoreCores

number of cpu cores (threads) to be ignored during parallized processing.

Value

a list of numeric vectors containing the selected item combinations that match the defined rules of forced_items and/or rules.

Examples

data(ADL)
forced <- c(1)
rules_object <- list() # rules-Object
rules_object[[1]] <- list("min", 1, 8:9)
rules_object[[2]] <- list("min", 1, 14:15)
rules_object[[3]] <- list("max", 2, 2:6)
rules_object[[4]] <- list("forbidden", c(8,9))
final_combos <- apply_combo_rules(combo_length = 5:7,
                                  full=1:length(ADL),
                                   forced_items = forced,
                                   rules= rules_object)

exhaustiveRasch documentation built on April 3, 2025, 6:18 p.m.