Learn R Programming

planor (version 1.5-3)

pick-methods: Extract a Single Result from a List

Description

Methods to extract a single '>designkey object (with one key matrix per prime) from a multi-components object.

Usage

# S4 method for listofdesignkeys
pick(keys, selection)
# S4 method for listofkeyrings
pick(keys, selection)

Arguments

keys

an object of the class.

selection

  • when keys is a '>listofdesignkeys object, an integer scalar equal to the position of the required solution.

  • when keys is a '>listofkeyrings object, the index vector to select the key matrix for each prime.

Value

An object of class '>designkey, which contains the selected design.

See Also

Classes where this method applies: '>listofdesignkeys, '>listofkeyrings.

Examples

Run this code
# NOT RUN {
### Creation of an object of class listofdesignkeys
K2 <- 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 pick applied on the listofdesignkeys object
K2.1 <- pick(K2,1)
K2.1 <- K2[1] ## Another way of extracting ([ is synonym of pick)

### Creation of an object of class listofkeyrings
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)
### Method pick applied on the listofkeyrings object
K0.1 <- pick(K0,1)
K0.1 <- K0[1] ## the same
# }

Run the code above in your browser using DataLab