View source: R/design_structure.R
| factorial_design | R Documentation |
Crosses every level of every factor, repeats each combination replications
times, and returns one numeric column per factor holding its coded level.
factorial_design(
factors,
replications = 1L,
coding = c("dummy", "effect", "level"),
id = "id"
)
factors |
Named numeric vector of whole numbers giving the number of levels per factor, each at least 2. The names become the design columns. |
replications |
Number of replications per factor combination. A single
positive whole number, defaulting to |
coding |
Numeric coding of the levels, one value per factor per row, one
of |
id |
Identifier-column name, numbering the rows. A single non-empty
string, defaulting to |
A simulab_sim base data.frame with one row per replicated factor
combination (replications * prod(factors) rows), the identifier column
first and then one coded column per factor. The component factors,
reached with as.data.frame(x, what = "factors"), holds one row per factor
with columns factor, the integer levels and coding.
factorial_design(factors = c(dose = 3L, timing = 2L), replications = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.