build_cell_names_r: Find All Possible Conditions

View source: R/RcppExports.R

build_cell_names_rR Documentation

Find All Possible Conditions

Description

Constructs all possible condition combinations (i.e., cells) based on experimental factors, parameter mappings, and response definitions. Returns both cell names and sorted factor definitions.

Usage

build_cell_names_r(parameter_map_r, factors_r, responses_r)

Arguments

parameter_map_r

An Rcpp::List where each element is a character vector mapping parameters to conditions. Names should correspond to parameters.

factors_r

An Rcpp::List where each element is a character vector of factor levels. Names should correspond to factor names.

responses_r

A character vector (std::vector<std::string>) of response/accumulator names.

Details

The function:

  1. Converts R lists to 'C++' maps for efficient processing

  2. Generates all condition combinations via Cartesian product

  3. Handles special parameter mappings (like mapping accumulators to conditions)

  4. Returns both cell names and the factor structure used

Value

An Rcpp::List with two elements:

  • cell_names: Character vector of all possible condition combinations

  • sortedFactors: The processed factor structure used to generate cells

Typical Workflow

This function is typically used to:

  1. Establish the full experimental design space

  2. Verify factor/parameter compatibility

  3. Generate condition labels for model specification

This function primarily is to debug the internal process of model building.

Examples

# A simple example
p_map <- list(A = "1", B = "1", t0 = "1", mean_v = "M", sd_v = "1",
               st0 ="1")
factors <- list(S = c("s1", "s2"))
responses <- c("r1", "r2")
result <- build_cell_names_r(p_map, factors, responses)

# cat("B (2 factors), t0, mean_v (3 factors), sd_v (2 factors)")
p_map <- list(
    A = "H", B = c("S", "G"), t0 = "E", mean_v = c("D", "H", "M"),
    sd_v = c("D", "M"), st0 = "1"
)
factors <- list(
    S = c("s1", "s2", "s3"), D = c("d1", "d2"), E = c("e1", "e2"),
    G = c("g1", "g2", "g3"), H = c("h1", "h2", "h3", "h4", "h5")
)
responses <- c("r1", "r2", "r3")
result <- build_cell_names_r(p_map, factors, responses)


ggdmcModel documentation built on Aug. 8, 2025, 7:50 p.m.