planor.design-methods {planor} | R Documentation

## Build a Design from a Design Key Solution

### Description

Methods to build a factorial design from an object containing key matrices.

### Usage

    ## S4 method for signature 'designkey'
    planor.design(key, randomize=NULL, ...)

    ## S4 method for signature 'listofdesignkeys'
    planor.design(key, randomize=NULL, selection=1, ...)

    ## S4 method for signature 'listofkeyrings'
    planor.design(key, randomize=NULL, selection,...)

    ## S4 method for signature 'numeric'
    planor.design(key, start=1)

### Arguments

`key` | an object of the first class in the signature, or a vector of integers.
`randomize` | an optional formula to specify the block structure for design randomization.
`selection` | when `key` is a `listofdesignkeys` object, an integer scalar. when `key` is a `listofkeyrings` object, should be an index vector to select the key matrix for each prime.
`...` | additional arguments, in particular those related to randomization (see `planor.randomize`).
`start` | an integer from where to start the series of symbols.

### Details

- When `key` is numeric, it should be a vector of integers of length `s`. Then, the function generates a full factorial n_1 x n_2 x ... x n_s design with columns considered as factors. It returns an integer matrix with prod(n) rows and s columns giving all combinations along the rows, in lexicographic order.

- When `key` is a `listofdesignkeys` object, build one design from a selected solution.

### Value

An object of class `planordesign`, which contains the design built from the input. This function is restricted to give a single design. When `key` is numeric, see Details.

### See Also

Classes where this method applies: `designkey`, `listofdesignkeys`, `listofkeyrings`.

### Examples

    ### Creation of a listofdesignkeys object
    K0 <- planor.designkey(factors=c("R","C","U","A","B1","B2"),
     nlevels=c(3,2,2,3,2,2), model=~R*C + (A+B1+B2)^2, estimate=~A:B1+A:B2,
     nunits=12, base=~R+C+U, max.sol=2)
    ### Method planor.design applied on the listofdesignkeys object
    P0 <- planor.design(key=K0, select=1)
    ### Method planor.design applied on a designkey object
    P0 <- planor.design(K0[1])

    ### Creation of a listofkeyrings object
    K0 <- planor.designkey(factors=c(LETTERS[1:4], "block"), nlevels=rep(3,5),
    model=~block+(A+B+C+D)^2, estimate=~A+B+C+D,
    nunits=3^3, base=~A+B+C, max.sol=2, verbose=TRUE)
    ### Method planor.design applied on a designkey object
    P0 <- planor.design(K0[1])
    P0.R <- planor.design(K0[1], randomize=~A+B+C+D) # randomize the final design

[Package planor version 1.5-1 Index]