# xDRDN: Extract a Design and Give it a Range and Dimnames In DiceDesign: Designs of Computer Experiments

## Description

Extract a design contained in a list (i.e. with a design item), adjust the range, give it dimnames and finally round the values to a certain number of digits. Colnames will look like (`A,B,C`), (`X1,X2,X3`), (`X01,X02,X03`), (`X001,X002,X003`).

## Usage

 `1` ```xDRDN(obj, width = 1, letter = "X", dgts = NULL, range = NULL) ```

## Arguments

 `obj ` a list that contains a `design` item. Matrix or data.frame are also accepted `width ` the digit width in colnames (to write for instance X1, X01, X001). If 0, colnames are filled with capital and small letters (without letters `I` and `i`) up to 50 columns `letter` the generic letter used in colnames `dgts ` the number of digits to which the design is rounded `range ` a vector `c(min, max)` to adjust the range of the design. The default `NULL` keeps the original range. Special ranges `c(0, 0)` and `c(1, 1)` are not accepted

## Value

A rounded matrix or a data.frame with appropriate dimnames and an adjusted range.

## Examples

 ```1 2 3 4``` ```xDRDN(lhsDesign(5, 12)) xDRDN(lhsDesign(5, 12), width = 2, letter = "V", dgts = 2, range = c(-10, 10)) head(xDRDN(olhDesign(50, range = c(1,1)), width = 0, letter = "Z"), 3) head(xDRDN(olhDesign(51, range = c(1,1)), width = 0, letter = "Z"), 3) ```

### Example output

```           X1        X2         X3         X4        X5         X6        X7
1 0.302254479 0.5322753 0.92882459 0.43612889 0.0687087 0.39904271 0.0170868
2 0.415550691 0.2437982 0.62101737 0.01898303 0.5979009 0.08407169 0.4327708
3 0.864958296 0.6279476 0.09326596 0.88163459 0.2409732 0.69590976 0.8962111
4 0.002896656 0.9722351 0.58279535 0.77973895 0.8305405 0.94328023 0.2545629
5 0.790860922 0.1354444 0.27668144 0.20659737 0.7652901 0.40844459 0.6607818
X8         X9       X10       X11        X12
1 0.48681192 0.99529247 0.9161409 0.3666463 0.25307222
2 0.77674087 0.72439291 0.4326081 0.8501679 0.64816444
3 0.07315661 0.08278904 0.3216332 0.4097719 0.85715458
4 0.99743577 0.28873774 0.6222345 0.1971326 0.05794449
5 0.34284786 0.54960311 0.1320186 0.6614089 0.42319726
V01   V02   V03   V04   V05   V06   V07   V08   V09   V10   V11   V12
1  -3.98  0.65  8.62 -1.29 -8.68 -2.03 -9.71 -0.27  9.96  8.37 -2.69 -4.97
2  -1.70 -5.16  2.43 -9.68  1.97 -8.37 -1.36  5.56  4.51 -1.36  7.04  2.98
3   7.34  2.57 -8.18  7.67 -5.21  3.94  7.96 -8.59 -8.39 -3.59 -1.82  7.18
4 -10.00  9.49  1.66  5.62  6.64  8.91 -4.94 10.00 -4.25  2.45 -6.09 -8.89
5   5.85 -7.33 -4.49 -5.90  5.33 -1.84  3.23 -3.16  0.99 -7.40  3.24 -1.55
A  B  C  D  E  F  G H  J  K   L   M   N   O   P  Q  R   S   T   U   V   W   X
1 1  2  3  4  5  6  7 8  9 10  11  12  13  14  15 16 17  18  19  20  21  22  23
2 2 -1 -4  3  6 -5 -8 7 10 -9 -12  11  14 -13 -16 15 18 -17 -20  19  22 -21 -24
3 3  4 -1 -2 -7 -8  5 6 11 12  -9 -10 -15 -16  13 14 19  20 -17 -18 -23 -24  21
Y  Z   a   b   c   d   e   f  g  h   j   k   l   m   n   o  p  q   r   s   t
1 24 25  26  27  28  29  30  31 32 33  34  35  36  37  38  39 40 41  42  43  44
2 23 26 -25 -28  27  30 -29 -32 31 34 -33 -36  35  38 -37 -40 39 42 -41 -44  43
3 22 27  28 -25 -26 -31 -32  29 30 35  36 -33 -34 -39 -40  37 38 43  44 -41 -42
u   v   w  x  y   z
1  45  46  47 48 49  50
2  46 -45 -48 47 50 -49
3 -47 -48  45 46 51  52
Z1 Z2 Z3 Z4 Z5 Z6 Z7 Z8 Z9 Z10 Z11 Z12 Z13 Z14 Z15 Z16 Z17 Z18 Z19 Z20 Z21
1  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21
2  2 -1 -4  3  6 -5 -8  7 10  -9 -12  11  14 -13 -16  15  18 -17 -20  19  22
3  3  4 -1 -2 -7 -8  5  6 11  12  -9 -10 -15 -16  13  14  19  20 -17 -18 -23
Z22 Z23 Z24 Z25 Z26 Z27 Z28 Z29 Z30 Z31 Z32 Z33 Z34 Z35 Z36 Z37 Z38 Z39 Z40
1  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40
2 -21 -24  23  26 -25 -28  27  30 -29 -32  31  34 -33 -36  35  38 -37 -40  39
3 -24  21  22  27  28 -25 -26 -31 -32  29  30  35  36 -33 -34 -39 -40  37  38
Z41 Z42 Z43 Z44 Z45 Z46 Z47 Z48 Z49 Z50 Z51
1  41  42  43  44  45  46  47  48  49  50  51
2  42 -41 -44  43  46 -45 -48  47  50 -49 -52
3  43  44 -41 -42 -47 -48  45  46  51  52 -49
```

DiceDesign documentation built on Feb. 13, 2021, 1:06 a.m.