Learn R Programming

DoE.base (version 0.5)

cross.design: Function to cross several designs

Description

This function generates cartesian products of two or more experimental designs.

Usage

cross.design(design1, design2, ..., randomize = TRUE, seed=NULL)

Arguments

design1
a data frame of class design that is not a blocked design; cf. details for what is allowed regarding replications; if design1 is not of class design, crossing will nevertheless work,
design2
a data frame of class design that is not a blocked design; can also be a vector if ... is not used; cf. details for what is allowed regarding replications
...
optional further data frames of class design that are to be crossed; the last element can also be a vector
randomize
logical indicating whether randomization should take place after crossing the designs
seed
seed for random number generation

Value

  • A data frame of class design with type crossed and the following extraordinary elements:
  • cross.nrunsvector of run numbers of individual designs
  • cross.nfactorsvector of numbers of factors of individual designs
  • cross.typesvector of types of individual designs
  • cross.randomizevector of logicals (randomized or not) of individual desigs
  • cross.seedvector of seeds of individual designs
  • cross.replicationsvector of numbers of replications of individual designs
  • cross.repeat.onlyvector of logicals (repeat.only or not) of individual designs
  • cross.selected.columnsNULL (if no oa type design) or list of column vectors for each design
  • cross.creatorlist of creator components for each design
  • Some of the standard elements are list or vectors (e.g. creator) for crossed designs. A simple data frame without design information, if design1 is not of class design

Details

Crossing is carried out recursively, following the direct.sum approach from package conf.design. Crossing blocked designs is not supported. The last crossed design can also be a vector. If replications are desired, it is recommended to accomodate them in the last design. Only the last design may have repeat.only replications. If the last design has repeat.only replications and there are also proper replications in earlier designs, a warning is thrown, but the repeat.only replications are nevertheless accomodated; this is experimental and may not yield the expected results under all circumstances.

See Also

See Also param.design

Examples

Run this code
## creating a Taguchi-style inner-outer array design
   ## with proper randomization
   ##   function param.design would generate such a design with all outer array runs 
   ##     for each inner array run conducted in sequence
   ##   alternatively, a split-plot approach can also handle control and noise factor 
   ##     designs without necessarily crossing two separate designs
   des.control <- oa.design(ID=L18.2.1.3.7)
   des.noise <- oa.design(ID=L4.2.3,nlevels=2,factor.names=c("N1","N2","N3"))
   crossed <- cross.design(des.control, des.noise)
   crossed
   summary(crossed)

Run the code above in your browser using DataLab