build_cell_names_r | R Documentation |
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.
build_cell_names_r(parameter_map_r, factors_r, responses_r)
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. |
The function:
Converts R lists to 'C++' maps for efficient processing
Generates all condition combinations via Cartesian product
Handles special parameter mappings (like mapping accumulators to conditions)
Returns both cell names and the factor structure used
An Rcpp::List with two elements:
cell_names
: Character vector of all possible condition
combinations
sortedFactors
: The processed factor structure used to
generate cells
This function is typically used to:
Establish the full experimental design space
Verify factor/parameter compatibility
Generate condition labels for model specification
This function primarily is to debug the internal process of model building.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.