pick-methods: Extract a Single Result from a List

Description Usage Arguments Value Note See Also Examples

Description

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

Usage

1
2
3
4
## S4 method for signature 'listofdesignkeys'
pick(keys, selection)
## S4 method for signature '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.

Note

pick(K0,1) can be simply written K0[1]

See Also

Classes where this method applies: listofdesignkeys, listofkeyrings.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
### 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

planor documentation built on March 19, 2020, 1:06 a.m.